Stack Exchange
ProgressDialog.Refresh () - Unable to add window - token android.os.BinderProxy is not valid; is your activity running? in xamarin android
We are using Acr.UserDialogs nuget in our application. We are getting below error in appcenter.
ProgressDialog.Refresh ()
Java.Lang.RuntimeException: Unable to add window -- token android.os.BinderProxy@23d80a3 is not valid; is your activity running?
android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@23d80a3 is not valid; is your activity running?
android.view.ViewRootImpl.setView ViewRootImpl.java:1061
android.view.WindowManagerGlobal.addView WindowManagerGlobal.java:381
android.view.WindowManagerImpl.addView WindowManagerImpl.java:93
android.app.Dialog.show Dialog.java:470
mono.java.lang.RunnableImplementor.n_run(Native Method)
mono.java.lang.RunnableImplementor.run RunnableImplementor.java:30
android.os.Handler.handleCallback Handler.java:873
android.os.Handler.dispatchMessage Handler.java:99
android.os.Looper.loop Looper.java:214
android.app.ActivityThread.main ActivityThread.java:7100
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:494
com.android.internal.os.ZygoteInit.main ZygoteInit.java:964

How to reslove this in xamarin.android?

Did you put this line of code in MainActivity.cs under OnCreate() method
UserDialogs.Init(this);


I got this issue as well and I have this line of code in MainActivity.cs under OnCreate()
