Is the memory management of an activity changed by binding to a local service? In other words, if an activity binds to a local service, does the system try to keep the activity alive? Or is there no effect on the activity itself?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your activity should unbind from the service if it is stopped (is not shown). When the activity is active Android will not remove it unless its runs out of memory.
But the service profits from the bound activity: http://developer.android.com/guide/topics/fundamentals/services.html
“The Android system will force-stop a service only when memory is low and it must recover system resources for the activity that has user focus. If the service is bound to an activity that has user focus, then it’s less likely to be killed, and if the service is declared to run in the foreground (discussed later), then it will almost never be killed.”