问题
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