title: switch loop into a for: why is every case true?
body: <pre><code>for(int i = 0; i &lt;= lvl-1; ++i) {
  
          id = sequence.get(i);
  
          switch(id) {
          case 1:
              sq1.setBackgroundResource(R.drawable.square_show);
  
              hnd.postDelayed(new Runnable() {
                  public void run() {
                      sq1.setBackgroundResource(R.drawable.square);
                  }
              }, 2000);
  
              break;
          case 2:
              sq2.setBackgroundResource(R.drawable.square_show);
  
              hnd.postDelayed(new Runnable() {
                  public void run() {
                      sq2.setBackgroundResource(R.drawable.square);
                  }
              }, 2000);
  
              break;
          case 3: ...
  </code></pre>
  
  <p>Do you have any idea why when this cicle is passed through, each and every one of the cases are true?
  As if var "id" is 1, 2, 3 AND 4 AND 5 and every else</p>
  
  <p>The code doesn't wait the 2 seconds between each loop, but gets them as true at the 1st one</p>