2

There are many problems on the backend server, but the logs do not indicate where the problem occurred. How can I find the cause of the problem?

android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@dff00ec is not valid; is your activity running?

at android.view.ViewRootImpl.setView(ViewRootImpl.java:579)

at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:310)

at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)

at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3187)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495)

at android.app.ActivityThread.-wrap11(ActivityThread.java)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)

at android.os.Handler.dispatchMessage(Handler.java:102)

at android.os.Looper.loop(Looper.java:148)

at android.app.ActivityThread.main(ActivityThread.java:5443)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
She wenbiao
  • 31
  • 1
  • 3

1 Answers1

0

Try the code below before showing dialog

if (this.hasWindowFocus()) {
    dialog.show();
}
Liar
  • 1,235
  • 1
  • 9
  • 19