How to make an Android app not be killed?

Source: Internet
Author: User

Resources:

Http://blog.sina.com.cn/s/blog_3e3fcadd0100yjo2.html

http://blog.csdn.net/windskier/article/details/6560925
http://blog.csdn.net/zmyde2010/article/details/6756368
Http://blog.sina.com.cn/s/blog_514048cb0100wi2j.html

Http://www.cnblogs.com/ylligang/articles/2665181.html

Method:

① for a service, you can first set it to run in the foreground

②android:persistent= "true". It is also the process resident system that applies to apps placed under/system/app. will never be killed. can be protected from out-of-memory killer.

It is not possible to completely keep the process from being killed, and we can make the process less likely to kill by doing something:
1) Increase the priority of the process:
* Background operation takes the form of service running in the foreground, because a process running a service is higher than a running background activity;
* Pressing the back key causes the activity in the process to run in the background instead of the destory, which requires the reload of the backend button (no activity is first killed in the running process).
* Reliance on other high-priority processes;

2) Force modify process properties:
* Set in Process: Setpersistent (TRUE);
* Set in the manifest file (as above).

How to make an Android app not be killed?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.