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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:46:36+00:00 2026-06-09T09:46:36+00:00

In Eclipse Classic I am developing an android app that has numerous save SharedPreferences

  • 0

In Eclipse Classic I am developing an android app that has numerous save SharedPreferences and all with the same name of SharedPreference similar to below:

SavePreferences("NAME_OF_THE_SHAREDPREFERENCE", ("Some random text"));

But I want to change the name of the SharedPreference in another class. This will (if its possible) save me lot of time, instead of changing them one by one.

I know the Ctrl+H comand but I am not able to find the “NAME_OF_THE_SHAREDPREFERENCE”, and/or replace it with another name.

Feel free to ask questions if something is hard to understand by my explinations:-)

  • 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-09T09:46:38+00:00Added an answer on June 9, 2026 at 9:46 am

    Is it because these strings are different?

    NAME_OF_SHAREDPREFERENCE
    

    is different from (missing “THE_”):

    NAME_OF_THE_SHAREDPREFERENCE
    

    Ok, that was just a typo… But you can use Find/Replace in each file Ctrl+F.


    I also recommend using a static variable instead of a hard-coded String:

    class ClassA {
        public static final String SHAREDPREFERENCE_FILENAME = "something";
    
        ...
        mSharedPreferences = getSharedPreferences(SHAREDPREFERENCE_FILENAME, MODE_PRIVATE);
    }
    
    class ClassB {
        ...
        mSharedPreferences = getSharedPreferences(ClassA.SHAREDPREFERENCE_FILENAME, MODE_PRIVATE);
    }
    

    This way you only have to update one location.

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

Sidebar

Related Questions

Eclipse is complaining about my Android project saying all my references to resources are
I want to install Android SDK on Eclipse Classic Indigo (Version: 3.7.1 Build id:
Please forgive if this question has been asked numerous times. I recently installed Eclipse
I'm trying to get into Android app developing. My first problem is actually getting
I am using Eclipse classic to develop my Android applications. But I am not
I've just download Eclipse + Android SDK, I was making the classic hello world
I added 32-bit android adk to eclipse(Classic, Indigo, Version: 3.7.0 Build id: I20110613-1736) in
I've downloaded Eclipse Classic 3.5 Galileo, the last version of Android SDK, downloaded and
I have ADT loaded onto classic Eclipse. I followed the steps from the Android
I just installed Eclipse Classic to develop a BB app in Java.. Im following

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.