❶ 如何动态修改ListVIew中每个Item的值
给你一个源代码参考一下,希望能帮到你,谢谢
public void UpdateList(int selectedItem)
{
ListAdapter la = m_List.getAdapter();
int itemNum = m_List.getCount();
for(int i=0; i<itemNum; i++)
{
HashMap<String, Object> map = (HashMap<String, Object>)la.getItem(i);
if ( i == selectedItem)
map.put("ItemIcon", R.drawable.image1);
else
map.put("ItemIcon", R.drawable.image2);
}
((SimpleAdapter)la).notifyDataSetChanged();
}