android - How do I test for activity inactivity time -


I am thinking that when the user contacts me with my application, then in what order can I go to the highest level

Introduction: After X seconds of user inactivity I want to log out of my application. So what I have done is making a service with the timer, and toggle function which resets the timer at x time, after anime has passed, an intention is raised, and a broadcast receiver captures that effect and Logout (also locking open logging activities ...)

For the real question, I need to interact with the user app every time to call the "timer toggle" function. Tax Is obtained. Where Android is the highest point in the app where I know that when the user contacts the phone

I have to execute on whatever I have found onClick and onKeyPress for every activity, is there any other Better way? Maybe in the application class?

I do not think sending any event in any other way will result in activity .
You can see overriding.

But it is likely that the user will be in a single activity for your app, without ever switching the screen or leaving the device sleepy "x seconds"?

I think the timer / flag will be enough to update onCreate , onPause and onResume . Besides activity . Some commonly functions within


Comments