Tim Moores wrote:Android apps generally have little control over that. You should assume that an app gets terminated soon after it is no longer in the foreground. That will not happen always, but you need to assume that it will.
That means the onPause method should save all information the app needs to restore its state when it next gets started. The javadoc of the Activity class has a lot of information about the lifecycle, and which of its methods you should override to make it a seamless user experience.
That bites, because my app is a number cruncher which, when you run numbers, can take a while to calculate. I wish there was a way for it to run in the background while the user of the phone can do other things on the phone.
It's a lottery app, and you can run numbers "until jackpot", which plays virtual day-after-day until you hit a jackpot and can take hours or longer to compute. So this would be a really great feature for the phone to have. It's unfortunate if the app can't run in the background. So you're saying there's nothing I can do about this?