在学习android listView控件的时候...按照预定从数据库中读取内容显示,可显示的结果叫人摸不着头脑,如图所示,显示的全部都是false
呵呵....我测试过,从数据库中读取的内容是正确的....
如果有遇到这样的结果的朋友 希望给与解答...在此谢谢了....
List<Person> persons = personServiceInter.getScrollData(0, 20);

List<HashMap<String, Object>> data = new ArrayList<HashMap<String,Object>>();

for (Person person : persons){

HashMap<String, Object> item = new HashMap<String, Object>();

item.put("name", person.getName());
item.put("phone", person.getPhone());
item.put("amount", person.getAmount());

data.add(item);
}

SimpleAdapter adapter = new SimpleAdapter(this, data, R.layout.item, 
new String[]{"name", "phone", "amount"}, new int[]{R.id.name, R.id.phone, R.id.amount});

listView.setAdapter(adapter);