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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Pavel
, 1 year ago
Unable to add window -- token null is not valid; is your activity running?
via Stack Overflow by Artem Shevchenko
, 2 years ago
Unable to add window -- token null is not valid; is your activity running?
via Stack Overflow by Redman
, 1 year ago
Unable to add window -- token android.view.ViewRootImpl$W@228edc12 is not valid; is your activity running?
via Stack Overflow by Unknown author, 2 years ago
Unable to add window -- token android.view.ViewRootImpl$W@1d3f737a is not valid; is your activity running?
via Stack Overflow by Amit Ranjan
, 1 year ago
Unable to add window -- token android.view.ViewRootImpl$W@245aa4ad is not valid; is your activity running?
via Stack Overflow by Giri
, 2 years ago
Unable to add window -- token android.view.ViewRootImpl$W@40ece840 is not valid; is your activity running?
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:678)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:279)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.widget.PopupWindow.invokePopup(PopupWindow.java:1070)
at android.widget.PopupWindow.showAsDropDown(PopupWindow.java:970)
at android.widget.ListPopupWindow.show(ListPopupWindow.java:644)
at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1114)
at mono.android.text.TextWatcherImplementor.n_afterTextChanged(Native Method)
at mono.android.text.TextWatcherImplementor.afterTextChanged(TextWatcherImplementor.java:33)
at android.widget.TextView.sendAfterTextChanged(TextView.java:7947)
at android.widget.TextView.setText(TextView.java:4084)
at android.widget.TextView.setText(TextView.java:3933)
at android.widget.EditText.setText(EditText.java:91)
at android.widget.TextView.setText(TextView.java:3908)
at android.widget.TextView.onRestoreInstanceState(TextView.java:3808)
at android.view.View.dispatchRestoreInstanceState(View.java:13795)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3022)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3022)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3022)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3022)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3022)
at android.support.v4.app.Fragment.restoreViewState(Fragment.java:465)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1094)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2046)
at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:174)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1228)
at android.app.Activity.performStart(Activity.java:5987)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2423)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2522)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4118)
at android.app.ActivityThread.access$900(ActivityThread.java:167)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1423)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5534)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:955)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
10 times, 1 month ago
19 times, 2 months ago
Samebug visitor profile picture
Unknown user
Once, 2 months ago
55 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.