title: How to temporarily pause a loop in Android?
body: <p>I've been developing a simon says game, but once I called the method to show the order of the buttons to be pressed, they are shown too fast. I already tried Thread.sleep(2000), Handler.postDelayed(new Runnable, 2000), but they did not work.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public void showOrder(){
      for(Integer elem : values){
          //Pauses for 2 seconds
  
          //************************************HOW????????????????
          switch (elem) {
              case 2131165245:
                  //buttonUp shines
                  buttonUp.startAnimation(vanish);
                  break;
              case 2131165246:
                  //buttonLeft shines
                   buttonLeft.startAnimation(vanish);
                    break;
              case 2131165247:
                   //buttonRight shines
                    buttonRight.startAnimation(vanish);
                    break;
              case 2131165248:
                   //buttonDown shines
                   buttonDown.startAnimation(vanish);
                   break;
          }
  
      }
  
  }
  </code></pre>
  
  <p>Hope someone helps me!</p>