Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8363589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:12:54+00:00 2026-06-09T12:12:54+00:00

How can I detect if a device has ‘do not keep activities’ set in

  • 0

How can I detect if a device has ‘do not keep activities’ set in developer options.
I can’t find this value in the settings-class.

I need this setting to know, because when ‘do not keep activities’ is activated my app gets problem with it.
Example : I have a main-activity and a sub-activity. when I switch from main to sub and back from sub to main, then the main-activity will be started again. This is because the mainactivity was killed before. besause I do a lot of loading in my main-activity, the app is not usable when starting over and over.

Or is there any method to solve this problem ?
Without this setting activated, there is no problem.

regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:12:55+00:00Added an answer on June 9, 2026 at 12:12 pm

    Is it possible to detect that flag by code ?

    Yes.

    In API Doc, it is called Settings.System.ALWAYS_FINISH_ACTIVITIES:

    If 1, the activity manager will aggressively finish activities and processes as soon as they are no longer needed. If 0, the normal extended lifetime is used.

    Constant Value: "always_finish_activities"

    To get the value in code:

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

    Check out the source code to see how Settings.apk did this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I detect if a windows mobile device has the keyboard extended? I
In Javascript/jQuery, how can I detect if the client device has a mouse? I've
I can detect my iPad device running an iPhone app in 1x or 2x
Does anyone know how I can detect if the headphone jack on a device
How can I detect that application was automatically started (auto-start when device turned on)
I'm trying to find a way to detect when a flash drive has been
How can I tell whether a given device has the ability to make phone
My application has to detect that the device connected to the Wi-Fi network is
How do I detect if the system has a default recording device installed? I
How can you use the accelerometer to detect if the phone has come to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.