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

Stack Overflow | MRefaat | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    how to display a pop_up window when losing the Internet connection?

    Stack Overflow | 3 years ago | MRefaat
    android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
  2. 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?
  3. 0

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

    Stack Overflow | 4 years ago | Vikram
    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

    how to show popup window in my main window?

    Stack Overflow | 6 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?
  6. 0

    Android PopupWindow wont open properly

    Stack Overflow | 6 years ago | RenegadeAndy
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.andy.tabletsms.tablet/com.andy.tabletsms.work.SMSPopup}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
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:646)
    2. android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
    3. android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
    4. android.widget.PopupWindow.invokePopup(PopupWindow.java:993)
    5. android.widget.PopupWindow.showAtLocation(PopupWindow.java:847)
    6. android.widget.PopupWindow.showAtLocation(PopupWindow.java:811)
    6 frames
  3. com.example.solaceap
    Login$5.run
    1. com.example.solaceap.Login$5.run(Login.java:135)
    1 frame
  4. Android Platform
    Activity.runOnUiThread
    1. android.app.Activity.runOnUiThread(Activity.java:4662)
    1 frame
  5. com.example.solaceap
    Login$6$1.run
    1. com.example.solaceap.Login.init_conn_lost_popup(Login.java:119)
    2. com.example.solaceap.Login$6$1.run(Login.java:281)
    2 frames