Displaying black transparent layer instead of alert
<p>I have developed an app where i am using Async task with in the async task after performing some operation in onPostExecute() method i am displaying an alert. Every thing is working fine but the problem is when application is coming from background instead of displaying a alert it is showing the black transparent layer. why it is happening?? Any ideas??</p>

<p>Here is my code snippet and steps to reproduce the issue:</p>

<p>Please create an activity to use async task:</p>

<pre><code>private class ImageUploaderTask extends AsyncTask&lt;Void, Integer, Void&gt; {

    ProgressDialog mProgressDialog;
    private void showLoading()
    {
        mProgressDialog = ProgressDialog.show(myActivity.this,
                "Loading", "Please wait...", false, false);
    }
    private void dismissLoading()
    {
        mProgressDialog.dismiss();
    }



    @Override
    protected void onPreExecute() {

        showLoading();



    }

    @Override
    protected Void doInBackground(Void... arg0) {
        try
        {
        Thread.sleep(50000);
        }
        catch (Exception e) {
            // TODO: handle exception
        }
    }



    @Override
    protected void onPostExecute(Void result) {
         dismissLoading();
         showAlert(myActivity.this,"Info","Process Finished.");

    }
    public  void showAlert(Context context, String Title, String Message) {
        AlertDialog.Builder alertbox = new AlertDialog.Builder(context);
        alertbox.setTitle(Title);
        alertbox.setMessage(Message);
        alertbox.setCancelable(false);
        alertbox.setPositiveButton("OK",null);
        alertbox.show();
    }
    @Override
    protected void onCancelled() {
         dismissLoading();
    }
}
</code></pre>

<p>Steps to Reproduce the Issue:</p>

<p>1)start the Async task and send the app to background</p>

<p>2) Make sure that Async task is completed and bring the app to foreground </p>

<p>3) Instead of the Alert it will show black tranparent screen.</p>
