这里有虫

来源:互联网 发布:淘宝网招聘兼职 编辑:程序博客网 时间:2024/04/28 17:21

Fatal signal 11 (SIGSEGV)

libc Fatal signal 11 (SIGSEGV) at 0x0000002c (code=1), thread 29948 (cn.gofire.fire)

多线程可能会引起的问题,一个线程回收了某个东西,另一个线程的底层还在使用,就会报这个错误。

也可以这么解释:dll 或 so崩了,多数是非法访问内存引起的,如访问越界,访问非法内存。

参考:Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)问题解决


java.lang.IllegalStateException

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(2131296264, class cn.gofire.hehe.common.view.PtrListView) with Adapter(class android.widget.HeaderViewListAdapter)]

ListView 的 adapter 不能在非主线程更新,包括 adapter 里面的 list 数据,所以要异步拉取数据的话,要分开两个不同的 list 来处理。

详细请参考:http://blog.csdn.net/fxtxz2/article/details/8123198

更改后,仍偶尔会出现(出现次数少了哦),然后发现这个帖子讲解得不错:记录一次IllegalStateException异常的解决过程。

简单来说,即要在 setAdapt 前先设置好 headerView。可是我已经是这样了,还偶尔会报错,要继续学习。


view not attached to window manager

延时或在线程里关闭弹出窗,可能会出现这个错误,原因是关闭时,父级 Activity 已经改变。参考1、参考2


javax.crypto.BadPaddingException: pad block corrupted

会出错代码:SecureRandom sr = SecureRandom.getInstance("SHA1PRNG"); 

运行正常的代码:SecureRandom sr = SecureRandom.getInstance("SHA1PRNG", "Crypto");

参考


Android下ListView上下滑动背景变黑

原因:手指在ListView上下滚动时,ListViewItem背景变黑,因为在滚动的时候为了提升性能做了优化,为提高滚动的性能,Android 框架在ListView中引入CacheColorHint属性。如果该值为非0,则说明该ListView绘制在单色不透明的背景上,在默认情况下该值 为#191919,也就是黑色主题中的黑色背景颜色值,这样当ListView滚动的时候就会使用该值来绘制ListView的背景。
两种解决办法:

  • xml - android:cacheColorHint="#00000000"  
  • Java - listview.setCacheColorHint(Color.TRANSPARENT);  

parseSdkContent failed
java.lang.ExceptionInInitializerError
Could not initialize class android.graphics.Typeface

升级 android 5.0 的 sdk 后就经常提示这个,别人说删除 .android 文件夹就好,但我这里还是不行,尝试了好多办法都未解决,先降级吧。



java.lang.IllegalArgumentException: Comparison method violates its general contract!

原因,比较器,只返回了-1和1,没有返回0

参考:http://www.tuicool.com/articles/MZreyuv



0 0