2

I found an error in AsyncTask's OnCancelled() method and the error is below:

Exception of type 'Java.Lang.IllegalArgumentException' was thrown.

java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView{41b1e790 V.E..... R.....ID 0,0-456,144} not attached to window manager

Code I am using inside OnCancelled() is:

if (progressDialog != null)
{
   if (progressDialog.IsShowing == true)
      progressDialog.Dismiss();
 }
Community
  • 1
  • 1
Ranjit Bisht
  • 157
  • 10

1 Answers1

1

This happens if your view was already destroyed by the time the AsyncTask's onCancelled event has fired. Look at this SO question

Community
  • 1
  • 1