title: How to use progressbar on android as an hp bar
body: <p>I am building some small project, it's about a game
  I managed to use progress bar as my hp bar in the game.
  It works, however, without any animation on it.
  Here 'damage' is an integer which is the damage to the hp bar.
  and hpBar is the hp bar corresponding to curHp</p>
  
  <pre><code>for( int i=0 ; i&lt;damage ; i++){
        new Handler().postDelayed(new Runnable(){ 
          @Override
          public void run(){
              --curHp;
              hpBar.setProgress(curHp);
          }
      },40);
  
  
  }
  </code></pre>
  
  <p>I thought there will be a 40ms delay when hp decrease by 1.
  But infact, if the damage is 40, the hpBar decrease at a time after 1.6s</p>
  
  <p>Is there any solution about making the progressBar decrease by an amount of number and moves smoothy?</p>