出现以下异常,是因为Activity释放,附加的Dialog未释放导致。
E: android.view.WindowLeaked: Activity com.XXXXXX.device.activity.XXXXXXActivity has leaked window DecorView@8837277[XXXXXXActivity] that was originally added here
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:839)
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:823)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:393)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:134)
at android.app.Dialog.show(Dialog.java:374)
at com.XXXXXX.XXX.dialog.LoadingDialog.show(LoadingDialog.java:85)
at com.XXXXXX.device.activity.XXXXXXActivity.lambda$showDialog$1$XXXXXXActivity(XXXXXXActivity.java:1386)
at com.XXXXXX.device.activity.-$$Lambda$XXXXXXActivity$sIn8NFhMIkdpd83CaNcsYJKmmjU.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8292)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)