WindowManager: android.view.WindowLeaked:

显示

Dialog
之前做判断是否已经显示

if (!loadingDialog.isShowing())
    loadingDialog.show();

否则容易出现如下异常

09-09 13:49:23.636 24217-24217/com.moreunion.zhenghao E/WindowManager: android.view.WindowLeaked: Activity com.moreunion.zhenghao.ui.diary.DiaryBookDetailActivity has leaked window DecorView@f108082[] that was originally added here
                                                                           at android.view.ViewRootImpl.(ViewRootImpl.java:418)
                                                                           at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:331)
                                                                           at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
                                                                           at android.app.Dialog.show(Dialog.java:329)
                                                                           at com.example.yilibrary.utils.viewutils.UtilsDialog.showDialog(UtilsDialog.java:130)
                                                                           at com.example.yilibrary.base.BaseActivity.showLoad(BaseActivity.java:104)
                                                                           at com.moreunion.zhenghao.presenter.DiaryBookDetailPresenter.getData(DiaryBookDetailPresenter.java:99)
                                                                           at com.moreunion.zhenghao.ui.diary.DiaryBookDetailActivity$2.run(DiaryBookDetailActivity.java:330)
                                                                           at android.os.Handler.handleCallback(Handler.java:751)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                           at android.os.Looper.loop(Looper.java:154)
                                                                           at android.app.ActivityThread.main(ActivityThread.java:6121)
                                                                           at java.lang.reflect.Method.invoke(Native Method)
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

你可能感兴趣的:(Android)