title: How can i pause and resume progress bar in android?
body: <p>Hi i am using a progressbar and i need to pause it and resume it. This is my code:</p>
  
  <pre><code>new Thread(new Runnable() {
          public void run() {
              while (progressStatus &lt; 100) {
                  progressStatus += 1;
  
                  handler.post(new Runnable() {
                      public void run() {
                          progressbar.setProgress(progressStatus);
  
                      }
                  });
                  try {
  
                      Thread.sleep(1000);
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
              }
          }
      }).start();
  </code></pre>
  
  <p>Can anyone please help me.Thanks in Advance.</p>