android.view.WindowManager$BadTokenException

Unable to add window -- token null is not for an application

Solutions on the web792

  • via Coderanch by Saad Zahoor, 1 week ago
    Unable to add window -- token null is not for an application
  • via GitHub by gattacus
    , 2 months ago
    Unable to add window -- token null is not for an application
  • Unable to add window -- token null is not for an application
  • Stack trace

    • android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application at android.view.ViewRootImpl.setView(ViewRootImpl.java:576) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:269) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) at android.app.Dialog.show(Dialog.java:289) at android.app.AlertDialog$Builder.show(AlertDialog.java:951) at cn.bvin.app.androidtest_asgit.MainActivity$1.onClick(MainActivity.java:24) at android.view.View.performClick(View.java:4446) at android.view.View$PerformClick.run(View.java:18480) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5294) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680) at dalvik.system.NativeStart.main(Native Method)

    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

    2 times, 5 months ago
    2 times, 11 months ago
    2 times, 1 year ago
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    52 more bugmates