title: IllegalArgumentException: View not attached to window manager . Dialog.dismiss
body: <p>I have a little error i want to get rid of.
  I have no idea why this error occurs.
  The simulator and test phone runs perfect!
  The only info I have is the Stacktraces I got from the app users in android Market.</p>
  
  <pre><code>java.lang.IllegalArgumentException: View not attached to window manager
  at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355)
  at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200)
  at android.view.Window$LocalWindowManager.removeView(Window.java:432)
  at android.app.Dialog.dismissDialog(Dialog.java:278)
  at android.app.Dialog.access$000(Dialog.java:71)
  at android.app.Dialog$1.run(Dialog.java:111)
  at android.os.Handler.handleCallback(Handler.java:587)
  at android.os.Handler.dispatchMessage(Handler.java:92)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:4627)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  at dalvik.system.NativeStart.main(Native Method
  </code></pre>
  
  <p>First i thought the code below would cause the application to crash if the user change the phone's orientation while the progress dialog is not yet dismissed.
  I made shure the orientation would not change by adding:    android:screenOrientation="portrait".
  But the error is still alive.</p>
  
  <p>Could any one help me out?
  This is a code example which i use:</p>
  
  <pre><code>final ProgressDialog pd = ProgressDialog.show(this, "Title", "Message",  true, false);
  
  new Thread(new Runnable(){
  public void run(){
      makeHttpRequest();
      pd.dimiss();
  }
  }).start();
  </code></pre>