title: Calling multiple times same AsyncTask in adapter class button clicked method
body: <p>I had <code>AsyncTask</code> in my adapter class when i calling first time it's working fine. But when i call second time it doesn't work.</p>
  
  <p>I know when we want to call same task multiple times in activity class we have to call <code>new MyTask.execute()</code>.But here am created my task in non activity class (i.e Adapter class) so here am unable to instantiate my task. How can i resolve this problem? Please provide any solution.</p>
  
  <p>This is my code:</p>
  
  <pre><code>public AsyncTask&lt;String,Void,Void&gt; mytaskfavorite = new AsyncTask&lt;String,Void,Void&gt;() {
    protected void onPreExecute() {
      pd = new ProgressDialog(mContext);
      pd.setMessage("Loading...");
      pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      //proDialog.setIcon(R.drawable.)
      pd.setCancelable(false);
      pd.show();
      System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
    }
    @Override
    protected Void doInBackground(String...code) {
      String buscode = code[0];
      // TODO Auto-generated method stub
      addFavoriteBusinessSelection.addFavoriteBusinessBusinessSelection(buscode);
      System.out.println("##################################" + buscode);
      return null;
    }
    @Override
    protected void onPostExecute(Void res) {
      pd.dismiss();
    }
  };
  </code></pre>