Retry AsyncTask
<p>For example I have following AsyncTask:</p>

<pre><code>  private class MyAsyncTask extends AsyncTask&lt;Void, Void, Boolean&gt; {


     @Override
     protected Void doInBackground(Void... params) {
         try {
             //some code that may throws exception
             return true;
         } catch (IOException ex) {
             return false;
         }
     }


     @Override
     protected void onPostExecute(Boolean param){
        if (!param) {
           AlertDialog.Builder builder = new AlertDialog.Builder(MyActivity.this);
           builder.setMessage("Error");
           builder.setPositiveButton("Retry", new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int which) {
                  //I want to retry MyAsyncTask here
              } 
           });
           builder.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int which) {
                 finish();
              } 
           });
           AlertDialog alert = builder.create();
           alert.show();
        }
     }
  }
</code></pre>

<p>What is best practice to do this? I'm afraid of recursion this code.</p>
