Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know "Don't keep activities" is enabled in ICS?

How to know in settings "Don't keep activities" option is enabled in ics via code. If it is in enabled,how to prevent the activity.

Note: I have used more activities in my application.Because of that settings if I move one activity to another the first activity is destroyed.I can save my data on the onSaveInstanceState. With out using saved instance state is there any way to do...

Thanks in advance..

like image 940
Finder Avatar asked Jul 25 '12 12:07

Finder


People also ask

How do I turn off don't keep activities?

If you play around with your phone's settings, then you will discover an option depicting “Don't keep activities” hidden under “Developer Options”.

How do you check if activity is finished or not?

Using activity. isFinishing() is the right one solution. it return true if activity is finished so before creating dialog check for the condition.

What does don't keep activities mean?

Don't keep activities under the Developer Options menu. When this option is enabled, the Android OS will destroy an activity as soon as it is stopped. It is intended to help developers debug their apps. For example, it can simulate the case that Android will kill an activity in the background due to memory pressure.


1 Answers

import the following package

import android.provider.Settings;

Then you can check if the option is enable using this code:

Settings.System.getInt(getContentResolver(),Settings.System.ALWAYS_FINISH_ACTIVITIES, 0);

and you can change it using this:

Settings.System.putInt(getContentResolver(),Settings.System.ALWAYS_FINISH_ACTIVITIES,  0);

Hope it helps

like image 188
Marin Vasvari Avatar answered Oct 01 '22 02:10

Marin Vasvari