how to keep my Launcher out of being kill by OS?

亡梦爱人 提交于 2019-12-22 20:24:44

问题


I am working on a project of 3rd-party Android Launcher. I find it being killed often by OS when running in background, even it is the default Launcher.

OS will kill many apps when available memory is not enough, I guest that the reason why my Launcher is killed.

So my question is what should I do to decrease the chance of being killed ?


回答1:


Nothing. You should find a way to handle the event where the OS kills your process, using a hacky approach to keep it in memory is bad, bad design and could lead to all sorts of issues on different devices.

You really shouldn't even care that the system is killing your process, the launcher should handle an intent and either resume if present or start if killed.



来源:https://stackoverflow.com/questions/20281388/how-to-keep-my-launcher-out-of-being-kill-by-os

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