How to prevent an android activity to get killed

三世轮回 提交于 2019-11-29 18:11:18

If you use a Service and make sure it stays active (by first starting it and simply not stopping it) the application wont be killed (unless it's extremely low on memory of course).

You should use a service instead of using an Activity to do work in the background.

Does your application have to be an activity? Can it utilize a background service?

http://developer.android.com/reference/android/app/Service.html#ServiceLifecycle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!