Error: View not attached to window manager
<p>I am getting the following remotely from clients so I don't know what hardware etc they are using.</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:417)
       at android.app.Dialog.dismissDialog(Dialog.java:279)
       at android.app.Dialog.access$000(Dialog.java:72)
       at android.app.Dialog$1.run(Dialog.java:108)
       at android.app.Dialog.dismiss(Dialog.java:263)
       at com..mysite.android.ActivityGame$1.onFinish(ActivityGame.java:154)
       at android.os.CountDownTimer$1.handleMessage(CountDownTimer.java:118)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:123)
       at android.app.ActivityThread.main(ActivityThread.java:4203)
       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:799)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
</code></pre>

<p>This is happening because of a ProgressDialog</p>

<pre><code>    progressDialog = new ProgressDialog( this );
    progressDialog.setMessage(getString(R.string.get_ready));
    progressDialog.setCancelable(false);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    progressDialog.setMax(12);
    progressDialog.show();

    new CountDownTimer(3000, 250) {

         @Override
        public void onTick(long millisUntilFinished) {
             //progressDialog.incrementProgressBy(1);
         }

         @Override
        public void onFinish() {
             progressDialog.dismiss(); //********* ERROR HAPPENS HERE *********
             nextQuestion();
         }
    }.start();
</code></pre>

<p>The Activity looks like this in the Manifest.</p>

<pre><code>&lt;activity android:theme="@style/GameTheme" android:name=".ActivityGame" android:screenOrientation="portrait" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation"&gt;&lt;/activity&gt;
</code></pre>

<p>So what could this mean?  I think it has something to do with the Activity being destroyed then created but as you can see I have the configChanges set correctly.</p>
