Home > Blockchain >  android.view.WindowManager$BadTokenException[How To Fix]
android.view.WindowManager$BadTokenException[How To Fix]

Time:10-29

According to google play, two of my users got this crash in the last month so I want to fix and prevent it from happening again but I don't know what type of crash this is can anybody help track down what is happening here so that I can fix it.

the crash log *according to google play dev

android.view.WindowManager$BadTokenException: 
  at android.view.ViewRootImpl.setView (ViewRootImpl.java:1126)
  at android.view.WindowManagerGlobal.addView (WindowManagerGlobal.java:439)
  at android.view.WindowManagerImpl.addView (WindowManagerImpl.java:95)
  at android.app.Dialog.show (Dialog.java:473)
  at androidx.appcompat.app.AlertDialog$Builder.show (AlertDialog.java:1009)
  at com.easyadsmm.androidapp.SplashScreen$1.onFailure (SplashScreen.java:508)
  at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.lambda$onFailure$1 (DefaultCallAdapterFactory.java:96)
  at retrofit2.-$$Lambda$DefaultCallAdapterFactory$ExecutorCallbackCall$1$7JZMXmGMmuA6QMd5UmiN1rIhtW0.run (-.java:6)
  at android.os.Handler.handleCallback (Handler.java:883)
  at android.os.Handler.dispatchMessage (Handler.java:100)
  at android.os.Looper.loop (Looper.java:237)
  at android.app.ActivityThread.main (ActivityThread.java:7948)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1075)

also, one final note my app had a total of 16 crashes this month and I got about 150 new and returning users this month meaning 10.7% of my users crashed is this a good or bad crash rate The app is new it been active for 2 months now and I am fixing all the bugs as they come

CodePudding user response:

It's generally a race condition when you try to show a dialog after you no longer have permission to (you're being backgrounded). Generally its good enough to just catch and ignore this exception.

  • Related