Dev Options->Don't Keep Activities

svfd757

Well-known member
Feb 10, 2012
667
54
0
I was poking around the Dev options and stumbled across the "Don't keep activities" option. What exactly does this do? It sounds to me like an app killer, kinda. Does this create any positive and or negative functionality on my apps?
 
I was wondering the same thing

Sent from my Galaxy Nexus using Xparent Red Tapatalk 2
 
Negative, don't use it. It's intended for developing for a reason. In normal use you NEED to allow things to run in the background, close out properly, etc. Enabling it for no reason will probably lead to freezes, force closes, reboots, and global thermonuclear war.
:)
 
I used it. The only thing I noticed was that there was app history.
For example, if I had my browser open and navigated away from it, then went back to it, the home page came up instead of the page I was on.

I wish people would stop using the "developer option for a reason" excuse.
Windows animations and stay awake are in developer options too. They don't cause any harm.
 
Definately an app killer!...Downloaded our app unto a phone today and suddenly the app refused to load! The app has a background service which determines which page is loaded on first use and as it creates activities, this app killer kills them of!

I was actually surprised my barber had this option turned on...currently looking for how to detect and kill it before starting app.
 
I used it. The only thing I noticed was that there was app history.
For example, if I had my browser open and navigated away from it, then went back to it, the home page came up instead of the page I was on.

I wish people would stop using the "developer option for a reason" excuse.
Windows animations and stay awake are in developer options too. They don't cause any harm.

Actually, it is a "developer option for a reason." It is not an excuse. About this option, Google's Dev site says this:

Tells the system to destroy an activity as soon as it is stopped (as if Android had to reclaim memory). This is very useful for testing the onSaveInstanceState(Bundle) / onCreate(android.os.Bundle) code path, which would otherwise be difficult to force. Choosing this option will probably reveal a number of problems in your application due to not saving state. For more information about saving an activity's state, see the Activities document.

It is supposed to be used for testing an app's ability to save its state when the OS shuts it down. The OS normally only does that when you get close to running out of memory.

Ultimately, the end result of turning this option on for non-development reasons is two-fold:
  1. Longer app launch time and shorter battery life... Apps need to do more work than necessary to launch because they are always launching from scratch
  2. Unexpected behavior from apps where developers forgot to test their ability to save their state when they are forced to shutdown
 
Negative, don't use it. It's intended for developing for a reason. In normal use you NEED to allow things to run in the background, close out properly, etc. Enabling it for no reason will probably lead to freezes, force closes, reboots, and global thermonuclear war.
:)

Yes he's correct. It would totally mess up your phone and create a huge delay and or freezing the phone. It's not an app killer like you thinking
 
An Activity is name for Android OS process running in memory. Sometimes, like when the phone is tilted, the code has to "tear down" the Activity and rebuild it because the new orientation might use different resources. In a way, this is almost like closing and re-opening an application.

So, any bookmark or "placement" type data would typically be destroyed. However, developers stash data so it can survive recycle of Activity. But sometimes for testing they may want to disable keeping Activities so that any navigation away from or minimizing of the application destroys the activity; that way they can test if their code is correctly stashing user data. Otherwise, it might seem like it is working, but it's not because the Activity was not actually being destroyed.

It reminds me of coding javascript on web pages and how sometmies something seems to work or not work because the browser is caching the javascript you just changed!
 
Negative, don't use it. It's intended for developing for a reason. In normal use you NEED to allow things to run in the background, close out properly, etc. Enabling it for no reason will probably lead to freezes, force closes, reboots, and global thermonuclear war.
:)

Apologize for this late reply but sometimes an older reply helps clarify more too as tech goes on.
There are apps that can be affected when 'Keep activities' are turned off. Example the built-in camera app. When the activities are turned off, your camera settings menu will immediately close off the moment you open it. Why that happens is beyond my understanding but all I can make out of it is that it has to keep log of changes to your app settings and that means your 'activity' with your phone.
(Also I think it's a means of snooping by force.)