There is a piece of code, you need to restart the timer when you press the button. That while he did not tick. Help, please, already tortured.
Timer:
timer = new Timer(); timer.schedule(new TimerTask() { @Override public void run() { runOnUiThread(new Runnable(){ @Override public void run(){; Rand(); } }); } }, 0, 2000); After pressing the button, the timer should restart:
switch (v.getId()) { case R.id.button: if (button1.getText() == String.valueOf(n1 + n2)) { result++; //вот тут его надо перезагрузить Rand(); }