title: SetText isn't working inside for loop
body: <p><strong>Note:</strong> I searched google and here for few hours, but didn't get the answer.</p>
  
  <p>I want to show the value what will  <code>for loop</code> return. Here is my code:</p>
  
  <pre><code>mProgressBar = findViewById(R.id.progressBar);
          percentText = findViewById(R.id.percent);
  
          mProgressBar.setMax(100);
          mProgressBar.setProgress(0);
  
          new Thread(new Runnable() {
              @Override
              public void run() {
                  try{
                      for (int progress = 0; progress&lt;100; progress++){
                          mProgressBar.setProgress(progress);
                          percentText.setText(progress);
                          sleep(30);
                      }
  
                  }catch (Exception e){
                      e.printStackTrace();
                  }finally {
                      Intent intent = new Intent(SplashScreenActivity.this, SignUpLoginActivity.class);
                      startActivity(intent);
                  }
  </code></pre>
  
  <p>App crashing while I'm adding this line <code>percentText.setText(progress);</code>. Without this line, code is working well. What should I do to show the progress value to the TextView?</p>