AlertBox - Error occured while executing doInBackground()
<pre><code> public class IdAsync extends AsyncTask&lt;String, Void, Void&gt; {

 AlertDialog alertDialog = new AlertDialog.Builder(MainClass.this).create();

    protected Void doInBackground(String... params) {
      .
       .
      alertDialog.setTitle("Reset...");
            alertDialog.setMessage("R u sure?");
             alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int which) {

                   //here you can add functions

                } });

   alertDialog.show();
      .
    .}
</code></pre>

<p>This gives Runtime error
E/AndroidRuntime(16606):    at android.app.Dialog.show(Dialog.java:241)</p>
