6 ms·
I have little Android experience so forgive me if this is obvious after using the device, but your description makes it sounds like you can't reliably know if a
by bmalicoat 17y ago
I have little Android experience so forgive me if this is obvious after using the device, but your description makes it sounds like you can't reliably know if an app will be in the state you left it, is that true? Meaning sometimes the OS will kill the app if necessary but other times it will not.
If that is the case I'd prefer the iPhone way wherein the onus is on the developer to preserve the state and if they have, the app will always return to the way you left it or, if they haven't it will always be restarted from scratch. For me, knowing is better than not knowing.
However, if it is the case that the OS rarely kills apps then the Android method seems preferable.
- theBobMcCormick 17y agoThat would be highly unusable, but fortunately that's not the way Android works. Roughly what happens is that when an app (actually an Activity.. but we won't get into the difference right now) is no longer visible to the user, the OS automatically saves most of the apps state, and calls the apps onStop method to signal the app to save any app specific state. If the app is later killed, the next time it's started one of the items passed to the app by the OS is a reference to the previously saved state. The effect for the user is much like you describe it for the iPhone. It's as though your apps never die. Whenever you restart them, whether it's 5 minutes from now or 5 days, everything is exactly as you last left it. Except that, unlike on a PC, those "background apps" don't take up any resources. Obviously there is room for poorly written apps to flub up, or for apps to override the normal behavior for specific reasons.