android.view.WindowManager$BadTokenException

Unable to add window" on buider.show() I am using DialogFragments and AlertDialogs, I guess it could be the core issue but it just doesn't add up since it only affects Marshmallow users. Fatal Exception: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web530

  • via GitHub by jehy
    ,
  • Stack trace

    • android.view.WindowManager$BadTokenException: Unable to add window" on buider.show() I am using DialogFragments and AlertDialogs, I guess it could be the core issue but it just doesn't add up since it only affects Marshmallow users. 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:561) at com.android.internal.widget.FloatingToolbar.show(FloatingToolbar.java:212) 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:7224) 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)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    AdrienAdrien
    Once,
    Unknown visitor
    Unknown visitorOnce,
    jkjk
    4 times, last one
    Stefan BrauneStefan Braune
    Once,
    Unknown visitor
    Unknown visitorOnce,
    52 more bugmates