title: android: handler
body: <p>I am developing a kind of memory game app, where initially the 6 buttons will show some figures. Then when the below MyCount5sec and handler operates, after 5 sec of waiting period for user to remember, the handler will invoke txtClearRun whereby all the texts on every buttons to be erased.</p>
  
  <p>Then after the 5 sec waiting period, it comes the testing period. The user has to select the button in sequence, ie. the latter button value must need to be greater than the earlier button value.</p>
  
  <p>If the user is sucessful (ie. pressed all 6 number buttons), the app should wait 1.5 sec according to postDelay? Yet it appears that there are no delays.</p>
  
  <p>If the user is wrong, ie. pressed button with value smaller than the previous one, the user fails and the app should also wait 1.5sec, with the button highlighted in red. However, it seems that there are no such 1.5sec delay too. No highlighting in red neither.</p>
  
  <h2>Question</h2>
  
  <ol>
  <li>Why there appears no delays? TWO handlers cannot be invoked at the same time?</li>
  <li>how could that be further modified?</li>
  </ol>
  
  <p>Thanks a lot!!</p>
  
  <pre><code>   private void setQup() 
     {    
            .....
  
            MyCount5sec counter5sec = new MyCount5sec(6000,1000);
             counter5sec.start(); 
             handler.postDelayed(txtClearRun, 6000);
  
             pressed = 0;
             temp = 0;
             final int txtClearRun1time = 1500; // set here!
             button_space1.setText("reset press "+pressed);
  
             Button11.setOnClickListener(new OnClickListener() {@Override 
                    public void onClick(View v) {vibrate(); int i=0; Button11.setEnabled(false);
                      if (i == B0) {puttobutton(B0,0);} if (i == B1) {puttobutton(B1,1);} if (i == B2) {puttobutton(B2,2);}
                      if (i == B3) {puttobutton(B3,3);} if (i == B4) {puttobutton(B4,4);} if (i == B5) {puttobutton(B5,5);}
                      pressed = pressed + 1;
                      int buttonvalue = Integer.parseInt(Button11.getText().toString());                    
                      if (pressed &gt;5) 
                      {
                          TotalScores=TotalScores+20;
                          handler1.postDelayed(txtClearRun1, txtClearRun1time);
                          loadNextQup();                      
                      }                   
                      if (buttonvalue &lt; temp) 
                      {
                          Button11.setBackgroundResource(R.drawable.red_btn);
                          TotalScores=TotalScores-10;
                          handler1.postDelayed(txtClearRun1, txtClearRun1time);                       
                          loadNextQup();
                      }
                      temp = buttonvalue;
                      }});
  
      ......same for other buttons..
      }
  
  
     Runnable txtClearRun = new Runnable()
     {
         public void run() {blankbutton();} //remove text on buttons
     };
  
     Runnable txtClearRun1 = new Runnable()
     {
         public void run() {} // solely for wish to delay operations
     };
  
     private void loadNextQup()
     {
  
         if (TerminateOrNot ==0) 
         {
             handler.removeCallbacks(txtClearRun);
             handler1.removeCallbacks(txtClearRun1);
             setQup();
         }
           ....
         }
  </code></pre>