0
I’m having a little problem with a quiz application. when the user clicks on the button the next question comes. put a delay of 1 sec. However, if the user clicks 2x on the button within this delay of 1 sec, when opening 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);
Can you be more specific or show some example?
– gmbc
I have a quiz with one question and four answers, four buttons. If the user gives 2 clicks on the first answer... the first and second question are answered by the button. I showed you the code, 'cause I want a 1 sec Sleep.. Then the user of 2 clicks, the question waits 1 sec and is answer, opens the second question and is answered (after 1 sec too) also by double clicking on the first question. I can’t explain it any more clearly.
– Dan Even