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

Stack Overflow | RyanCheu | 5 months ago
  1. 0

    Issue on Android 6.0.1 "Fatal Exception: android.view.WindowManager$BadTokenException"

    Stack Overflow | 5 months ago | RyanCheu
    android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
  2. 0

    Bad token exception - Unable to add window (Marshmallow - Floating toolbar)

    Stack Overflow | 4 months ago | Lucas A
    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?
  3. 0

    Display popup on start of activity

    Stack Overflow | 2 years ago | Zac Powell
    java.lang.RuntimeException: Unable to start activity ComponentInfo{jabu.com.languagetemplate/jabu.com.languagetemplate.GameActivity}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    PopupWindow.showAtLocation() causes WindowManager$BadTokenException when using onSaveInstanceState() to handle device rotation

    Stack Overflow | 3 years ago | Vikram
    android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
  6. 0

    how to show popup window in my main window?

    Stack Overflow | 5 years ago | ganesh
    java.lang.RuntimeException: Unable to start activity ComponentInfo{popupTest.popupTest/popupTest.popupTest.popupTest}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?

  1. jk 4 times, last 6 months ago
  2. Stefan Braune 1 times, last 8 months ago
1 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. android.view.WindowManager$BadTokenException

    Unable to add window -- token null is not valid; is your activity running?

    at android.view.ViewRootImpl.setView()
  2. Android Platform
    PopupWindow.showAtLocation
    1. android.view.ViewRootImpl.setView(ViewRootImpl.java:849)
    2. android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:337)
    3. android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
    4. android.widget.PopupWindow.invokePopup(PopupWindow.java:1329)
    5. android.widget.PopupWindow.showAtLocation(PopupWindow.java:1077)
    6. android.widget.PopupWindow.showAtLocation(PopupWindow.java:1035)
    6 frames
  3. Android
    FloatingActionMode$1.run
    1. com.android.internal.widget.FloatingToolbar$FloatingToolbarPopup.show(FloatingToolbar.java:563)
    2. com.android.internal.widget.FloatingToolbar.show(FloatingToolbar.java:214)
    3. com.android.internal.view.FloatingActionMode$FloatingToolbarVisibilityHelper.updateToolbarVisibility(FloatingActionMode.java:411)
    4. com.android.internal.view.FloatingActionMode$1.run(FloatingActionMode.java:65)
    4 frames
  4. Android Platform
    ActivityThread.main
    1. android.os.Handler.handleCallback(Handler.java:739)
    2. android.os.Handler.dispatchMessage(Handler.java:95)
    3. android.os.Looper.loop(Looper.java:158)
    4. android.app.ActivityThread.main(ActivityThread.java:7229)
    4 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Method.java)
    1 frame
  6. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    2 frames