ViewRoot$CalledFromWrongThreadException 和内存泄漏

Activity XXX.XXX has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@46021980 that was originally added here
01-15 14:48:13.153: E/WindowManager(6360): android.view.WindowLeaked: Activity  XXX.XXX has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@46021980 that was originally added here

以上内存泄漏,有一种情况是Activity释放时,基于它的Dialog等没有释放导致的。





android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views


UI的更新只能在UI线程,也就是主线程中更新,否则就会产生如上错误。


发布了98 篇原创文章 · 获赞 27 · 访问量 111万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览