Search code examples
androidbuttonback

App not destroyed while interacting with other apps?


Is it possible that my activity is not destroyed when i press the back key on my device? It should have a button to do so. But i want it to continue running while i check my emails or something!


Solution

  • Yes it's possible, but you're not supposed to rely on it. Android simply leaves it in memory until it absolutely needs to be destroyed. If you want something to run in the background until it's done, then you want to use a Service.