originally专题

【已解决】Activity MainActivity has leaked window PhoneWindow$DecorView@ that was originally added here

今天写Sqlite Demo时,发生如下错误: Activity me.dengfengdecao.android.savedatademo.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@536caa40 that was originally added

关闭Activity.finish()之后出现 Activity has leaked window that was originally added 错误

该错误是由于在Activity中创建并显示了Alertdialog,但并未使用Activity提供的showDialog()方法,因此导致在Activity被结束后,Alertdialog所引用的context为空。 解决办法为 1.将dialog采用oncreateDialog的方式创建,交由系统维护。 2.在onDestroy()方法中将该alertdialog dismiss掉。

DecorView@ba3a7e3[InputHouseRentActivity] that was originally added here

场景:在activity中创建了一个dialog,并给dialog中加了一个回调 出现的原因:dialog在回调的时候并没有dismiss 解决方法:回调完之后dismiss就好了

Android常见错误之android.widget.LinearLayout@4375f248 that was originally added here

Activity xiaosi.tab.tabActivity has leaked window android.widget.LinearLayout@4375f248 that was originally added here 原因:       是在在Activity中显示了PopupWindow ,但在退出Activity 时没把PopupWindow 关闭。 解决方

Dialog显示引起的问题 Activity has leaked window DecorView@5704632[] that was originally added here

dialog显示引起的界面无法打开的问题,报错信息如下: 03-08 18:02:48.521: E/WindowManager(6340): Activity com.linc.megatron.activity.ExamActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@405