我在我们的崩溃日志中看到这个错误仅来自 Android 6.0.1 设备,但不是特定于设备的。
Fatal Exception: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:849)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:337)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
at android.widget.PopupWindow.invokePopup(PopupWindow.java:1329)
at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1077)
at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1035)
at com.android.internal.widget.FloatingToolbar$FloatingToolbarPopup.show(FloatingToolbar.java:563)
at com.android.internal.widget.FloatingToolbar.show(FloatingToolbar.java:214)
at com.android.internal.view.FloatingActionMode$FloatingToolbarVisibilityHelper.updateToolbarVisibility(FloatingActionMode.java:411)
at com.android.internal.view.FloatingActionMode$1.run(FloatingActionMode.java:65)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
有谁知道这个问题的原因/解决方案?它似乎相对很少发生。