How do I not miss the next screen?

0

I'm having a little problem with a quiz application. when the user clicks the button comes the next question. I set a delay of 1 sec. However, if the user clicks 2x on the button within this delay of 1 sec, when they open the next question it will already be clicked.

     private void ResetTempo() {
     mCountDownTimer.cancel();
     mTimeLeft = StartTempo;
     try {
        new Thread().sleep(1000);
     } catch (InterruptedException e) {
        e.printStackTrace();
     }
     mCountDownTimer.start();
     }

           r4.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            r4.setEnabled(false);
            ResetTempo();         

            updatePerguntasoma(r.nextInt(mPerguntasomaLenght));
                    r4.setEnabled(true);
    
asked by anonymous 27.06.2018 / 03:10

1 answer

0

I believe that if you disable the button while it is in the delay already solve.

myButton.setEnabled(false); 
    
27.06.2018 / 14:02