title: Progress is not increasing in progress dialog Android Studio
body: <p>I am using the following code in Android Studio:</p>
  
  <pre><code>    final ProgressDialog pr1 = new ProgressDialog(this);
      pr1.setMessage("Loading... ");
      pr1.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
      pr1.setIndeterminate(true);
      pr1.setProgress(0);
      pr1.setMax(99);
      pr1.show();
      final Thread t1 = new Thread(new Runnable() {
          @Override
          public void run() {
              int i;
              for(i=0;i&lt;=99;i++) {
                  //some code here
                  pr1.incrementProgressBy(1);
              }
              pr1.dismiss();
          }
      });
      t1.start();
  </code></pre>
  
  <p>now whenever i run this, progress dialog shows and run but the progress bar can not increment its just showing off.</p>