HwLauncher﹕ Launcher dialog dismiss failed : java.lang.IllegalArgumentException: no dialog with id 1

来源:互联网 发布:linux就该这么学 在线 编辑:程序博客网 时间:2024/06/14 08:52

现象:用手机做模拟器一直出现错误:HwLauncher﹕ Launcher dialog dismiss failed : java.lang.IllegalArgumentException: no dialog with id 1

logcat中还提示:WindowManager﹕ android.view.WindowLeaked: Activity com.zhy.imageloader.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{41d89e78 V.E..... R....... 0,0-684,192} that was originally added here

即内存泄露了
 

有人说:不是内存泄露,是因为activity和dialog同时显示,要先dialog.dismiss()后再activity.finish(),直接finish()掉activity会出错。

但是我重新onDestroy()为下面的代码后仍然出错

@Override    protected void onDestroy() {        if(mProgressDialog != null) {            mProgressDialog.dismiss();        }        super.onDestroy();    }


后来根据HwLauncher﹕ Launcher dialog dismiss failed : java.lang.IllegalArgumentException: no dialog with id 1这个异常查找原因,结果提示的是没有插内存卡!但是手机的内存卡明明在啊!为了先把程序运行出来,就先用PC端的模拟器试一下吧~

结果:在PC端的模拟器中就正常没有错误。


0 0
原创粉丝点击