java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receiv
2015-01-08 15:05
459 查看
意思大体是,你的adapter的内容变化了,但是你的ListView并不知情。请保证你adapter的数据在主线程中进行更改!
public class OrderAdapter extends BaseAdapter { private ArrayList<Map<String, Object>> lists; private Context context; private Handler handler; private BranchIdCallBack branchIdCallBack; public OrderAdapter(ArrayList<Map<String, Object>> list, Context context, Handler handler) { super(); this.lists = list; this.context = context; this.handler = handler; } @SuppressWarnings("unchecked") public void setDeviceList(ArrayList<Map<String, Object>> list) { if (list != null) { lists = (ArrayList<Map<String, Object>>)list.clone(); notifyDataSetChanged(); } } public void clearDeviceList() { if (lists != null) { lists.clear(); } notifyDataSetChanged(); } @Override public int getCount() { return lists==null?0:lists.size(); }
adapter数据发生变化要及时刷新。
相关文章推荐
- java.lang.IllegalStateException:The content of the adapter has changed but ListView did not receiv问题
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
- java.lang.IllegalStateException: The content of the adapter has changed but ListView...的问题
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
- The content of the adapter has changed but ListView did not receive a notification,java.lang.IndexOu
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
- java.lang.IllegalStateException: The content of the adapter has changed but
- java.lang.IllegalStateException: The content of the adapter has changed but
- java.lang.IllegalStateException: The content of the adapter has changed but
- 解决java.lang.IllegalStateException: The content of the adapter has changed but ListView...的问题
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- Android问题3-ListView Adapter(The content of the adapter has changed but ListView did not receive a n)
- 处理The content of the adapter has changed but ListView did not receive a notification异常