title: Android ProgressDialog in AsyncTask
body: <p>I can't make ProgressDialog run in AsyncTask :</p>
  
  <pre><code>private class Upload extends AsyncTask&lt;String, Void, Void&gt; {
  ProgressDialog pd;
  
      protected void onPreExecute() {
          super.onPreExecute();
              pd = new ProgressDialog(Activity.this);
              pd.setMessage("Message");
              pd.setIndeterminate(false);
              pd.setMax(100);
              pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
              pd.setCancelable(false);
              pd.show();
          }
  
         @Override
          protected Void doInBackground(String... params) {
  
                  .......
  
                   public void write(byte[] bts, int st, int end) throws IOException {
                              totalSent += end;
                              progress = (int) ((totalSent / (float) contentLength) * 100);
                              publishProgress("Loaded "+progress+"%");
                              out.write(bts, st, end);
                          } 
  
                   .......
  
                  }
  
              protected void onProgressUpdate(String... progress) {
              Log.d("ANDRO_ASYNC", progress[0]);
              pd.setProgress(Integer.parseInt(progress[0]));
          }
  
  
      protected void onPostExecute(Void result) {
                    super.onPostExecute(result);
            if (pd != null)
            {
               pd.dismiss();
            } 
                }
  </code></pre>
  
  <p>Progress dialog works, but no progress on it. However in logs I see, that progress counts properly.
  So, no problems in progress count.</p>
  
  <p>For the code above I get an error, saying "The method publishProgress(Void...) in the type AsyncTask String,Void,Void is not applicable for the arguments (String)".</p>
  
  <p>It doesn't work no matter what I do. I suppose, that I miss something. Please help )</p>