[android-developers] restart application after Android's killed it

2011-07-20 Thread Fina Perez
Hi all!

As far as I know, Android kills an application after sometime if the
user is not interacting with it, in order to save memory. If the user
goes back to the application, the last activity is displayed again.
What I would like to do is that when this situations occurs, I always
would like to restart from my main activity. But only if my
application was killed, not in other scenarios.

Is there any way to do that? in the manifest for example?

Thanks in advance!

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


Re: [android-developers] restart application after Android's killed it

2011-07-20 Thread Mark Murphy
On Wed, Jul 20, 2011 at 7:02 AM, Fina Perez fina.pere...@gmail.com wrote:
 As far as I know, Android kills an application after sometime if the
 user is not interacting with it, in order to save memory. If the user
 goes back to the application, the last activity is displayed again.

That depends on how the user goes back to the application. If they
click on the launcher icon, they will go to the launcher activity. If
they navigated back to the destroyed activity via the BACK button or
something like that, they will go to that specified activity.

 What I would like to do is that when this situations occurs, I always
 would like to restart from my main activity. But only if my
 application was killed, not in other scenarios.

Why?

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

Android Training...At Your Office: http://commonsware.com/training

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