Use a Timer. Set it´s intervall to 1000 or so. Set a global var and set the value to 3*60 (180)
In timer tick you count down the global variable (-1)
- Whenever a action is made. Reset the global var to 180
- When reaching 0 stop the timer and call Activity.Finish