Getting IllegalArgumentException in Android?
<p>In my application I am calling a JSON web-service from Activity <strong>A</strong> after getting response from that service, I am opening another Activity "SMSActivity" to send sms as <strong>startActivityForResult</strong>. After sending SMS when I am came back to my last activity <strong>A</strong> in <strong>OnActivityResult</strong> I am calling another web service to verify <strong>VerifyMySMS</strong> on which </p>

<pre><code>1) Progress dialog is not visible
2) application crashes on progress dialog cancel event.
</code></pre>

<p>Please suggest me, what could be the problem is. ?? 
Below are my crash logs : </p>

<pre><code>02-16 17:21:50.612: E/AndroidRuntime(7124): java.lang.IllegalArgumentException: View not attached to window manager
02-16 17:21:50.612: E/AndroidRuntime(7124):     at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at android.view.Window$LocalWindowManager.removeView(Window.java:432)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at android.app.Dialog.dismissDialog(Dialog.java:278)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at android.app.Dialog.access$000(Dialog.java:71)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at android.app.Dialog$1.run(Dialog.java:111)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at android.os.Handler.handleCallback(Handler.java:587)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at android.os.Handler.dispatchMessage(Handler.java:92)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at android.os.Looper.loop(Looper.java:123)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at android.app.ActivityThread.main(ActivityThread.java:4627)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at java.lang.reflect.Method.invokeNative(Native Method)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at java.lang.reflect.Method.invoke(Method.java:521)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
02-16 17:21:50.612: E/AndroidRuntime(7124):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>
