Android android.view.WindowManager$BadTokenException
<p>I am calling a methods which calls a dialog.</p>

<pre><code>showDialog(SOME_MESSAGE);

 switch (id) {
    case SOME_MESSAGE:
        pDialog = ProgressDialog.show(LocalActivity.this, "",
                getResources().getString(R.string.synchronizingData), true);
        pDialog.setOnKeyListener(keyListener);          
        return pDialog;
</code></pre>

<p>i am not closing this progress dialog in the onstop 
i am getting a <code>android.view.WindowManager$BadTokenException</code></p>

<pre><code>android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@44f1dfd8 is not valid; is your activity running?
</code></pre>

<p>this happens when i eneter another activity and quickly press back2 times</p>
