tags:

views:

34

answers:

3

Hi all, Is there a way to know application(any activity/sub activity/alert dialogs etc) idle timeout. For example if i did not respond to an activity for a particular time, how would i know the idle timeout for that activity. Actually i want to implement auto lock for a specific idle time interval.

Or is there a way to know that an event has been occurred inside application ( inside any activity/sub activity/alert dialogs etc) so that to run a custom method at that point to lock application. In other words any class that dispatches or sends all events for any activity/sub activity/ alert dialogs etc?

Currently i am handling onUserInteraction/onResume/onPasue etc events for each activity etc. but it is not reliable and require a lot of code.

Kind Regards Muhammad Rashid

A: 

You mean ANR application not responding (ANR) dialog? Have a look at the Designing for Responsiveness article in android docs Designing for Responsiveness.

If the UI thread is blocked for more than a few seconds (about 5 seconds currently) the user is presented with the infamous ANR dialog.

Do lock your app on timeout, you can use dialogs. A easy solution would be just to lo0k for touch input or something similar. If the screen is not touched for 2 minutes you just lock the app with a dialog...

ArtWorkAD
A: 

I am asking for activity idle time, means user did not interact with activity for a specific interval of time. How to detect that interval of time when activity performed no event by user. It is not ANR issue etc.

Muhammad Rashid
A: 

I need is a true or false of whether or not an event occurred anywhere on my app.

Muhammad Rashid