关于Android中xListView所出现的问题(点击后程序崩掉)
来源:互联网 发布:linux exit是什么意思 编辑:程序博客网 时间:2024/05/01 05:17
02-06 10:58:39.207: E/InputEventReceiver(764): Exception dispatching input event.
02-06 10:58:39.207: E/MessageQueue-JNI(764): Exception in MessageQueue callback:handleReceiveCallback
02-06 10:58:39.377: E/MessageQueue-JNI(764): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(16908298, class android.widget.ListView) with Adapter(class android.widget.SimpleAdapter)]
02-06 10:58:39.377: E/MessageQueue-JNI(764): at android.widget.ListView.layoutChildren(ListView.java:1538)
报错内容就是这样,翻译过来就是你adapter里面内容改变了但是他小伙伴ListView不知道啊,你要更新就到老大UI线程里面去操作。
问题所在:1.就是在你的list.clear()以后没有adapter.notifyDataSetChanged();
2.就是确保setadapter的值是在此类里面public MyAdapter(Context context,ArrayList<ShowParams> sList){
super();
this.context=context;
this.sList=(ArrayList<ShowParams>) sList.clone();
this.inf=LayoutInflater.from(context);
}
02-06 10:58:39.207: E/MessageQueue-JNI(764): Exception in MessageQueue callback:handleReceiveCallback
02-06 10:58:39.377: E/MessageQueue-JNI(764): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(16908298, class android.widget.ListView) with Adapter(class android.widget.SimpleAdapter)]
02-06 10:58:39.377: E/MessageQueue-JNI(764): at android.widget.ListView.layoutChildren(ListView.java:1538)
报错内容就是这样,翻译过来就是你adapter里面内容改变了但是他小伙伴ListView不知道啊,你要更新就到老大UI线程里面去操作。
问题所在:1.就是在你的list.clear()以后没有adapter.notifyDataSetChanged();
2.就是确保setadapter的值是在此类里面public MyAdapter(Context context,ArrayList<ShowParams> sList){
super();
this.context=context;
this.sList=(ArrayList<ShowParams>) sList.clone();
this.inf=LayoutInflater.from(context);
}
也就是将this.sList=sList;改为this.sList=(ArrayList<ShowParams>) sList.clone();就行了
ok,烦恼不在,让我们一起前进吧
0 0
- 关于Android中xListView所出现的问题(点击后程序崩掉)
- 关于Android中xListView所出现的问题(点击后程序崩掉)
- 关于.chosen()点击后出现自动隐藏的问题
- IllegalArgumentException 关于点击事件bindService后出现的问题
- 使用xlistview出现的问题
- Android程序中出现的问题
- 关于cocos2d-x(Android)集成广告点击广告后再点击back键退出桌面并出现黑屏问题
- 解决"打包成功后的ipa点击程序出现白屏,不能进入界面"的问题
- 解决"打包成功后的apk点击程序出现白屏,不能进入界面"的问题
- 关于Android点击物理返回键退出程序的问题
- vs2013中运行程序后出现的闪退问题
- 关于android studio升级后出现的一个问题
- 关于VS中复制窗体后出现的问题
- Android 关于点击后颜色不一样 再点击颜色还原的问题
- 【转】android生成项目后出现两个图标或点击程序提示未安装的解决办法
- Android中Xlistview的使用
- Android中Xlistview的使用
- Android中Xlistview的使用
- MapReduce Design Patterns(3.过滤器、布隆过滤器)(五)
- java日期 时间
- 澎湃的圣诞行情后,迎来元旦行情 2
- SQLite3命令操作与使用总结
- timesten:TT0802错误
- 关于Android中xListView所出现的问题(点击后程序崩掉)
- Mysql5 与 Mongodb2.4 简单性能对比
- Chapter 7 Caches
- [转载]table合并单元格 colspan(跨列)和rowspan(跨行)
- Adroid中广播接收者的使用,实现强制下线功能
- Openwrt
- 计算机网络术语详解
- msysgit安装与配置
- iOS开发_统计xcode代码行数