I’m facing one issue and I cannot find the solution.
My application has a PIN code and I want to un-verify it after 2 minutes without any action from user. For instance user verified the PIN and than leave the phone on the table (with running application) and I want to un-verify the pin after 2 minutes.
Question is how to scan the user activity (it means touch anywhere on the screen or buttons). Of course I can scan the touch on active components (buttons etc) but I also want to scan the touch anywhere on the screen to reset the timer.
Do you have any idea how to do it?
Thanks a lot!
you can override the activity’s main layout’s onTouchEvent to detect any touch gesture within the whole viewable area(which should fill the whole screen). just remember to return super.onTouchEvent to ensure that the other active components can still consume the event when they are touched separately.