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 3698442
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:58:54+00:00 2026-05-19T04:58:54+00:00

Steps: I start my Android app. I press the Menu button and select Preferences

  • 0

Steps:

  1. I start my Android app.
  2. I press the Menu button and select Preferences => preferences screen appears.
  3. I make a preference and then press the Back button => the application’s main activity appears again.
  4. I press the Back buttton => Home screen.
  5. I press the Home button and select my app => Preferences screen appears…why??

Main activity

@Override
protected void onResume()
{
   startService();
   super.onResume();
}

private void startService() 
{
   ...
   preferences = PreferenceManager.getDefaultSharedPreferences(this);   
   startService(new Intent(MainActivity.this, WeatherService.class));
   ...
}

@Override
protected void onPause()
{
   unbindService();
   super.onPause();
}


private void onPreferences() 
{
   Intent i = new Intent(MainActivity.this, Preferences.class);
   startActivity(i);
}

Preference activity

@Override
protected void onCreate(Bundle savedInstanceState) 
{
   super.onCreate(savedInstanceState);

   addPreferencesFromResource(R.xml.preferences);
}

Cheers,
Christian

  • 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-05-19T04:58:55+00:00Added an answer on May 19, 2026 at 4:58 am

    you should have used “singleInstance” as activity launch mode. If so, try to set it as “SingleTask”.

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

Sidebar

Related Questions

I'm working on my first Android app, and am almost to the point where
I would like to implement the following simple pattern in an android app: Activity
I'm trying to start doing Android development on OS X (trying is the key
I am taking my first steps in Android and am starting with a very
I using Eclipse Helios and JDK6 , The Android SDK virtual device make a
I want my application to check (before start installation) for Nokia_PC_Suite_rel_7_0_8_2 my steps are
i have a background service on my android APP that is getting my GPS
I have an android APP, with a lot of activities. In the login activiti
This is my first Android app and I've encountered an exception when trying to
Is there an easier way to step through the code than to start the

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.