title: A contradictory in Thread's work in android
body: <p>I tried to change my UI from my TimerTask and I recognized that it is impossible, because the TimerTask runs in a background thread and background threads are not allowed to change the UI.<br>
  Now my question is: I was changing a ProgressBar and a TextView from the TimerTask, and it worked for the ProgressBar but not for the TextView. Why is it possible for me to change the ProgressBar?  </p>
  
  <p>Why doesn't the ProgressBar have any problems with this?  </p>
  
  <pre><code>timer.scheduleAtFixedRate(new TimerTask() {
          @Override
          public void run() {
              int time = playerTimer(time);
  
              progressbar.setProgress(time);
              playerTime.setText(time);
  
          }
  
      }, 0, 1000);
  </code></pre>