CustomAdapter를 만들어서 getView에서 값을 확인하는데요
ArrayList에 HashMap을 담아서 보내는데
값들이 여러번 찍히는 이유는 무엇일까요?
// json 값은 총 길이가 3개 입니다.
for (int i = 0; i < android.length(); i++) {
JSONObject c = android.getJSONObject(i);
String name = c.getString("name");
HashMap<String, String> map = new HashMap<String, String>();
map.put("name", name);
oslist.add(map);
list = (ListView) findViewById(R.id.list0);
adapter = new CustomAdapter(TestActivity.this,oslist, R.layout.list_test, new String[] { "name" }, new int[] {R.id.name});
list.setAdapter(adapter);
}
[CustomAdapter]
HashMap<String, Object> data = (HashMap<String, Object>) getItem(position);
String name = (String)data.get("name");
Log.e("CustomAdapter", position + " : " + name);
여기서 로그가 3개 찍혀야 하는데 총 15번정도 찍히는 이유를 모르겠어요
좀 도와주세요 ㅠㅜ