my timer in eclipse did not work properly

后端 未结 1 1020
别跟我提以往
别跟我提以往 2021-01-28 22:48

I am new to eclipse and my timer in eclipse did not work properly, this is my java. code in the timer:

Button countDownButton2 = (Button) findViewById(R.id.count         


        
相关标签:
1条回答
  • 2021-01-28 23:30

    Disable the trigger button while the timer is running.

    That way you will save the pain to fiqure out how to do a switch or adding other actions to the button after the first click.

    You could try the yourbutton.setEnabled(false); to make it disabled.

    if i have understood the code right, it should be

    countDownButton2.setEnabled(false);

    To enable the button again, use

    countDownButton2.setEnabled(true);

    0 讨论(0)
提交回复
热议问题