suspend/resume messages on Android?

J. Landman Gay jacque at hyperactivesw.com
Tue May 7 14:34:53 EDT 2013


On 5/7/13 1:28 AM, Terry Judd wrote:
> I've been going back through the list archives and I'm still not
> exactly sure how you're supposed to deal with 'suspending' and
> 'resuming' an Android app. It seems that in most cases, and unlike in
> iOS, when you switch away from an Android app and then return to it
> it will be in the same state that you left it. That's a good thing,
> but I'd still like to receive some sort of message or notification
> when the user leaves and returns to the app as I potentially need to
> do some housekeeping depending on the interval between the leaving
> and the return. Is there a preferred way of doing this?

There is always a "shutdown" message sent when the user leaves the app, 
even if the OS keeps it available in the background.

Android manages app availability on its own. Usually if you leave an app 
and come back immediately or soon after, it will still be held in RAM 
and it will resume where it left off. But you can't rely on that. 
Android will wipe it from RAM whenever it needs more room, and that can 
be at any time. So it is best to always assume the app will be starting 
from scratch the next time it opens.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the Use-livecode mailing list