My concern is, how long will our activity be there in the stack?
What I mean is, when the home button is pressed from my app and then my app is launched again by clicking its icon, it will regain the correct place from where I pressed the home button without writing any special code for this.
I don't know whether I'm right, I think that my app is pushed to a stack, and when I launched it, it's pulled from the server.
I want to know how long will be in that stack or any other place where it is stored? Will it be replaced by some other app after pressing the home button and using many other apps?
Your activity will remain loaded until Android decides it needs the resources back. There are methods you can override in your activity to deal with this. Read more here.
Edit: See comment below for newer link.
You should also see the documentation on the Android Activity Lifecycle:
http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle
and Process Lifecycle:
http://developer.android.com/reference/android/app/Activity.html#ProcessLifecycle
http://www.edu4java.com/android_course/processes-and-threads.html#Lifecycle
There is a hierarchy of which activities will be killed first when Android needs to reclaim resources:
startService()
)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With