I want to detect user inactivity in my android application. When user log on the application a thread will start execution and check the time interval. After log on the application if user interact with the device i need to reset the time and when the user did not interact with the device application and the time exceeds, then i need to display a dialog (DialogFragment) to intimate the user. When user click on the dialog i need to reset the time again.
In the activity we can use onUserInteraction() method and reset the time. But if dialog (DialogFragment) shown in the screen how to reset the time.
And also we can use background thread for this concept or is there is any other way to handle this user inactivity in the application.
Thanks Mindus