android.view.WindowManager$BadTokenException:
at android.view.ViewRootImpl.setView (ViewRootImpl.java:1122)
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 me.hackerchick.raisetoanswer.MainActivity$onCreate$1$1.invoke (MainActivity.kt:70)
at me.hackerchick.raisetoanswer.MainActivity$onCreate$1$1.invoke (MainActivity.kt:27)
at me.hackerchick.raisetoanswer.RaiseToAnswerSensorEventListener$waitUntilDesiredState$1.run (RaiseToAnswerSensorEventListener.kt:172)
at java.util.TimerThread.mainLoop (Timer.java:562)
at java.util.TimerThread.run (Timer.java:512)
android.view.WindowManager$BadTokenException:
at android.view.ViewRootImpl.setView (ViewRootImpl.java:991)
at android.view.WindowManagerGlobal.addView (WindowManagerGlobal.java:387)
at android.view.WindowManagerImpl.addView (WindowManagerImpl.java:95)
at android.app.Dialog.show (Dialog.java:344)
at androidx.appcompat.app.AlertDialog$Builder.show (AlertDialog.java:1009)
at me.hackerchick.raisetoanswer.MainActivity$onCreate$1$1.invoke (MainActivity.kt:70)
at me.hackerchick.raisetoanswer.MainActivity$onCreate$1$1.invoke (MainActivity.kt:27)
at me.hackerchick.raisetoanswer.RaiseToAnswerSensorEventListener$waitUntilDesiredState$1.run (RaiseToAnswerSensorEventListener.kt:172)
at java.util.TimerThread.mainLoop (Timer.java:562)
at java.util.TimerThread.run (Timer.java:512)
My guess: someone pressed Test and then switch away from the app so the dialog can't open.
I stopped showing alert dialogs in 38dddd6 as a side effect of the refactoring (cannot create a dialog in a service) so... this crash will no longer happen.
My guess: someone pressed Test and then switch away from the app so the dialog can't open.