Downloading progress in AsyncTask android
<p>I am trying to create downloading progress. I have my class which extends AsyncTask:
<strong>public class DownloadFileTask extends AsyncTask</strong></p>

<p>When downloading starts i want to create progress:</p>

<pre><code>  @Override
  protected void onPreExecute() {



   progressDialog = new ProgressDialog(whatContext);
   progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
   progressDialog.setMessage("Loading...");
   progressDialog.setCancelable(false);
   progressDialog.show();
  }
</code></pre>

<p>But i don't know what context i should give to  new ProgressDialog becouse i am not in Activity class. I tried to give some context but there an error:</p>

<p><strong>No enclosing instance of the type Main_Tab is accessible in 
 scope</strong></p>

<p>So how i could create this progress ? </p>

<p>Also i wanted to create progress not in this class (becouse i want seperate functions and design), but i did't figure out how to do that.</p>

<p>Thank you guys for help.</p>
