On Sat, Apr 30, 2011 at 10:51 AM, Manohar Mahapatra
<[email protected]> wrote:
> Thanks for the reply. You are right , I could have used onResume in
> my secondary(not root activity) activities, but onResume will be called
>  even when I navigate between the activities in my app once it is launched.
> . I dont want to check the user token during this scenario as it would be a
> overkill.
> My requirement is if my application( hint app task level) as a whole is
> brought to foreground ( see the two cases below)
> a) From the Home page - works fine in this scenario
> b) From the Recent Apps - has the issue , here i cant know the onResume for
> any secondary activity  is called due to an internal navigation or due to
> the app task coming to the foreground again. So i thought of using
> the FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY from any of the secondary activity
> but I get 0 when I query for getFlags() in any of the secondary activity
> thanks

IMHO, your requirement is flawed. It's almost as flawed as those who
think they need to find out when their "application goes in the
background" to log people out.

Any sensible Web application would use a time-based mechanism based
upon session cookies. After N minutes (either since login or since
inactivity) -- or if there is no session cookie -- force a
re-authentication. IMHO, sensible Android applications will take the
same approach.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.6 Available!

-- 
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