hbb20 / CountryCodePickerProject

Country Code Picker (CCP) is an android library which provides an easy way to search and select country or international phone code. Also supports Android EditText phone mask and international phone validation.
Apache License 2.0
1.52k stars 505 forks source link

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

Open orafoxinc opened 4 months ago

orafoxinc commented 4 months ago

Process: com.example.android, PID: 10996 android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running? at android.view.ViewRootImpl.setView(ViewRootImpl.java:907) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:387) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:95) at android.app.Dialog.show(Dialog.java:342) at com.hbb20.CountryCodeDialog.openCountryCodeDialog(CountryCodeDialog.java:265) at com.hbb20.CountryCodePicker.launchCountrySelectionDialog(CountryCodePicker.java:2207) at com.hbb20.CountryCodePicker.launchCountrySelectionDialog(CountryCodePicker.java:2199) at com.hbb20.CountryCodePicker$1.onClick(CountryCodePicker.java:147) at android.view.View.performClick(View.java:7125) at android.view.View.performClickInternal(View.java:7102) at android.view.View.access$3500(View.java:801) at android.view.View$PerformClick.run(View.java:27336) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

We are use ViewPager with custom view without fragment