ListView内容变化后的动态刷新
基本知识点:
1.更新适配器Adapter数据源
2.调用适配器Adapter的刷新方法notifyDataSetChanged()
首先需要定义ListView和对应适配器Adapter:
//用于显示用户列表的ListView
private ListView userList = null;
//用户列表userList对应的适配器
SimpleAdapter simpleAdapter = null;
//用户列表userList对应的适配器的数据源
List<Map<String,?>> dataSimpleAdapter = new ArrayList<Map<String,?>>();
//用户列表ListView行布局元素
int[] userListViewTo = null;
//用户列表ListView行布局元素对应的适配器key值
String[] userListViewFrom = null;
/**
* 初始化用户列表组件适配器.
*/
public vo