3

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 ?

RoFF
  • 529
  • 5
  • 27

1 Answers1

7

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.

npace
  • 4,218
  • 1
  • 25
  • 35
  • 3
    +1 What you don't want is something like HTC sense with its loading icon while the launcher redraws. Nova launcher does have a 'keep in memmory' option but it will cause a lot of issues on lower end devices, and as you said is hacky. Nova really deals with it by being lightweight and streamlined and handles the intent so the user doesn't know, or care if it is redrawing or in memory. If your launcher takes time to draw (HTC Desire X is the prime example) then you should be wondering why it is so heavey and deal with that! – RossC Nov 29 '13 at 08:55