Hello, I'm wondering what is the highest level I can go in-order to know when the user interacts with my application
preface: I'd like to logout of my application after X seconds of user inactivity. so what I did is create a service with a timer, and a toggle function which resets the timer to X time. after X time has passed, an intent is raised, and a broadcast receiver catches that intent and preforms the logout (closing the open logged in activities as well...)
as for the actual question, I need to call the "Timer Toggle" function each time the user interacts with the application. where is the highest place in the android app that I can know when the user interacts with the phone
The only thing I found is to implement onClick and onKeyPress for each activity, is there another better way? maybe in the Application class?