When user click on the button (button is home activity) he will intent to game activity in 30 sec to 1 min user may win or lose and come back to home activity and then button must get disabled for 3 min (with time countdown showing) after 3 min button gets enable again and process repeat.
Please help me, It is the last part of my college project.
Wish you a Good Day!
Well a simple solution to that would be to use a countDownTimer.
You would start the timer when the user comes from the game activity. Then you could save the remaining time whenever the
onPauseis called and start over the countdown timer when theonResumeis called. When the remaining time reaches 0 then you will enable the button again. Lastly, you would need to save the remaining time in asharedpreferenceso that when the app is closed that you would start from the remaining time.