서버에서 받아온 데이터를 date값에 따라서 drawable에 있는 각가 다른이미지를 넣고 싶은데 <String,String>안에 삽입 하는 법을 모르겠습니다 혹시 아시는 분 계신가요??
protected void showList() {
try {
JSONObject jsonObj = new JSONObject(myJSON);
hwPlus = jsonObj.getJSONArray(TAG_RESULTS);
for (int i = 0; i < hwPlus.length(); i++) {
JSONObject c = hwPlus.getJSONObject(i);
String id = c.getString(db_id);
String name = c.getString(db_name);
String subject = c.getString(db_subject);
String date = c.getString(db_date);
final HashMap<String, String> db_hwlist = new HashMap<String, String>();
db_hwlist.put(db_id,id);
db_hwlist.put(db_name, name);
db_hwlist.put(db_subject, subject);
db_hwlist.put(db_date, "D-" + date);
hwList.add(db_hwlist);
}
ListAdapter adapter = new SimpleAdapter(
hwList.this, hwList, R.layout.list_item,
new String[]{db_pic,db_name, db_subject, db_date},
new int[]{R.id.img_list,R.id.name, R.id.subject, R.id.date}
);
list.setAdapter(adapter);
} catch (JSONException e) {
e.printStackTrace();
}
}