现在的位置: 首页 > 综合 > 正文

ViewRoot$CalledFromWrongThreadException 和内存泄漏

2013年07月11日 ⁄ 综合 ⁄ 共 497字 ⁄ 字号 评论关闭
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线程,也就是主线程中更新,否则就会产生如上错误。

抱歉!评论已关闭.