title: Horizontal progress bar does not update its status
body: <p>I am trying to show horizontal progress bar "<strong>Not ProgressDialog</strong>" on my activity like this
  <img src="https://i.stack.imgur.com/NRhT5.png" alt="enter image description here"></p>
  
  <p>here is what my xml file contains</p>
  
  <pre><code>&lt;ProgressBar
      android:id="@+id/pdialog"
      style="?android:attr/progressBarStyleHorizontal"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"        
      android:indeterminate="true"
       /&gt;
  </code></pre>
  
  <p>I am trying to update its status using AsyncTask Class by setting pdialog.setProgress() but its not showing any progress, it works with progressdialog but not with horizontal progress bar. </p>
  
  <pre><code>public class MainActivity extends Activity {
  
  private SQLiteDatabase db;
  private Cursor cursor;
  private ProgressBar pdialog;
  private ImageButton btn;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.start);
      btn = (ImageButton) findViewById(R.id.startbtn);
      pbar = (ProgressBar) findViewById(R.id.progressBar1);
      pdialog = (ProgressBar) findViewById(R.id.pdialog);
      pdialog.setMax(100);
      pdialog.setProgress(20);
      btn.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
              pdialog.setVisibility(View.VISIBLE);
              new DownloadFilesTask().execute();
  
          }
      });
  }
  
  private class DownloadFilesTask extends AsyncTask&lt;Void, Integer, Integer&gt; {
  
      int load = 1;
  
      protected Integer doInBackground(Void... params) {
  
          try {
                  load = 10 * i;
                  MainActivity.this.runOnUiThread(new Runnable() {
  
                      @Override
                      public void run() {
                          pdialog.setProgress(load);
                      }
                  });
  
              }
  
          } catch (Exception e) {     
  
          }   
  
      }
  
      protected void onProgressUpdate(Integer... progress) {
  
          if (progress[0] == 100) {
              pdialog.setVisibility(View.INVISIBLE);          
  
          }
      }
  
      protected void onPostExecute(Integer params) {      
  
      }
  
  }
  }
  </code></pre>