Android: Alert dialoge not showing
<p>I have AsyncTask, after it is doing I show some alert dialoge in onPostExecute. It is working fine.
But if during doInBackground the activity is stoped, after executing AsyncTask the alert dialoge is not showing after activity restart and the activity layout is dim in same way if dialoge is showing.</p>

<pre><code>public class CheckPin extends AsyncTask&lt;String, Void, Integer&gt;{
        @Override
        protected Integer doInBackground(String... uri) {
            publishProgress();
            //some code
            return ret;
        }
        @Override
        protected void onProgressUpdate(Void... values) {
            super.onProgressUpdate(values);
            showDialog(CHECKING_PIN);
        }
        @Override
        protected void onPostExecute(Integer result) {
            super.onPostExecute(result);
            dismissDialog(CHECKING_PIN);
            AlertDialog.Builder mBuilder = new                    AlertDialog.Builder(EnterPin.this); 
                    mBuilder.setMessage("Error") 
                            .setCancelable(false) 
                            .setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener() { 
                                public void onClick(DialogInterface dialog, int id) {
                                    finish();
                                } 
                            });
                        final AlertDialog mAlert = mBuilder.create(); 
                        mAlert.show();
                        break;


        }
    }
</code></pre>
