Android Exception 6 (adapter is not modified from a background thread)
07-23 09:47:34.962: E/AndroidRuntime(7001): 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(2131230794, class com.tongyan.widget.view.PullToRefreshListView) with Adapter(class android.widget.HeaderViewListAdapter)]
这个问题出现的场景是,在同一个Activity中,既使用了Thread,并且使用了AsyncTask
网上找来的:
1.改变适配器Adapter内容时不要在后台线程中,必须在UI线程中处理,这点可以通过Handler传出来解决。
2.尝试Adapter的notifyDataSetChanged()方法,当然主要看你代码的具体情况。
Android Exception 6 (adapter is not modified from a background thread)的更多相关文章
- 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. Make s
我出现这个问题是引用资源文件问题 helper.getView(R.id.in_pic).setBackgroundResource(item.getResourceId()); //错的helper ...
- Android中的Adapter 详解
http://blog.csdn.net/tianfeng701/article/details/7557819 (一) Adapter介绍 Android是完全遵循MVC模式设计的框架,Activi ...
- Android中各种Adapter的使用方法
1.概念 Adapter是连接后端数据和前端显示的适配器接口.是数据和UI(View)之间一个重要的纽带.在常见的View(ListView,GridView)等地方都须要用到Adapter.例如以下 ...
- Android高手进阶——Adapter深入理解与优化
Android高手进阶--Adapter深入理解与优化 通常是针对包括多个元素的View,如ListView,GridView.ExpandableListview,的时候我们是给其设置一个Adapt ...
- Android中AdapterView/Adapter的深度学习
BaseAdapter的深度学习 博主工作了几年,也用了几年的ListView等AdapterView控件,但关于Adapter的一些问题并没有深入下去,终于有时间学习总结下关于BaseAdapter ...
- [原]Android开发优化-Adapter优化
ListView作为Android开发中使用频率最高的一个控件,保证ListView的流畅运行,对用户体验的提高至关重要.Adapter是ListView和数据源之间的中间人,当每条数据进入可见区时, ...
- Android listview与adapter用法(BaseAdapter + getView)
Android listview与adapter用法http://www.cnblogs.com/zhengbeibei/archive/2013/05/14/3078805.html package ...
- java菜鸟篇<二> eclipse启动tomcat报错的问题:Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
9.1今天不知道自己瞎搞eclipse的时候按到了什么键,然后再启动程序的时候就会报错: 如下: Exception: java.lang.OutOfMemoryError thrown from t ...
- android开发在adapter中使用反射添加元素
android开发中最常用的控件之一就是listview,伴随listview还要有adapter和放入适配器的item.然后假设其中有一部分item的生成符合一定规律,Item item = new ...
随机推荐
- MySQL注射绕过技巧(三)
在测试一次注入的时候发现过滤了逗号 所以找到这个思路 第一次遇到的时候是看key哥挖洞 遇到后就想记录下来 正文 过滤了逗号 利用join来逐步查询 select*from(select 1)a ...
- Codeforces Round #245 (Div. 2) C. Xor-tree DFS
C. Xor-tree Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/430/problem/C ...
- X-009 FriendlyARM tiny4412 uboot移植之SD Card用起来Kernel boot起来
<<<<<<<<<<<<<<<<<<<<<<<<< ...
- matlab画直线,指定斜率与x坐标范围
闲话不说,直接上代码与图的效果!
- Android 新浪博客分享问题总结
分类: android(33) 版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[-] 我遇到BUG 1 sso package or singn error Bug2 ...
- Netty框架
Netty框架新版本号:3.0.2.GA,于2008年11月19日公布.Netty项目致力于提供一个异步的.事件驱动的网络应用框架和工具,用于高速开发可维护的.高性能的.高扩展性的server和cli ...
- [翻译] DFCircleActivityIndicator DF圆形活动状态指示器
DFCircleActivityIndicator Native, customizable and animated circular view to show when long activity ...
- sqlserver锁大全
锁定提示 描述 HOLDLOCK 将共享锁保留到事务完成,而不是在相应的表.行或数据页不再需要时就立即释放锁.HOLDL ...
- linux automake 交叉编译
. ├── aclocal.m4 ├── autoscan.log ├── config.log ├── config.status ├── configure ├── configure.in ├─ ...
- 《CUDA并行程序设计:GPU编程指南》
<CUDA并行程序设计:GPU编程指南> 基本信息 原书名:CUDA Programming:A Developer’s Guide to Parallel Computing with ...