Search code examples
javaandroidandroid-4.0-ice-cream-sandwich

do not keep activities option results in crashing my app


User reported, that my App restarts ( main activity ) when a subactivity is started ( started per Button ). I realized that the following option activated forces this : settings->{}developer options->'Do not keep activities' .

How can I prevent this ? Did I coded something wrong ?

Go-Launcher has the same Problem when opening settings-options in Go-Launcher. Go-Launcher popups a message with the advice to deactivate this setting.

Does anyone know howto read this setting ? I was not able to find the right variable of the class Settings.

regards


Solution

  • I got a solution from stackoverflow user 'yorkw'. Thanks alot to yorkw !

    I check if the option is activated. If so I show a dialog to warn the user.

    int value = Settings.System.getInt(getContentResolver(), Settings.System.ALWAYS_FINISH_ACTIVITIES, 0);
    

    regards