Maybe this would work, assuming all your activities run in the same process:

Implement every onStart and onStop of your activities like this:
In onStart(), increment a static (global) counter: e.g. visibleCount++;
In onStop(), decrement that static counter: e.g. visibleCount--;

In onStop, start (with delay) a Runnable on the UI-thread, that checks the 
value of 'visibleCount': If it is 0, then the user is not looking at any of 
your activities. In onStart, you may want to cancel that Runnable to avoid 
redundant checks.

However, I think a better solution would be to do the security checks when 
the activity is created (onCreate) or re-used (onNewIntent) based on the 
Intent (getIntent()/intent-parameter). 

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to