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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:21:37+00:00 2026-05-24T14:21:37+00:00

I am attempting to use a custom implementation of the SharedPreferences interface to persist

  • 0

I am attempting to use a custom implementation of the SharedPreferences interface to persist an application’s preferences to a database (instead of the default XML).

Why? I’d like to use the convenience of PreferenceActivity to construct the UI but this app will be used on multiple devices so the preferences a user sets need to persist across devices.

So.. I’ve got the implementation written, but can’t figure out how to associate a particular SharedPreference with a PreferenceActivity. I know that uses getSharedPreferences(), but how can I override that? Can i register my SharedPreferences somehow? I did not see anything in the API to do this.

Or … if I’m going about this all wrong please let me know. Thanks.

  • 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-24T14:21:38+00:00Added an answer on May 24, 2026 at 2:21 pm

    I’ve been investigating this question some time ago. For a different reason though.

    What I found is that PreferenceActivity is highly coupled with PreferenceManager and it uses PreferenceManager.getDefaultSharedPreferences() deep inside to get SharedPreference instance. And there is no way to either substitute custom PreferenceManager or SharedPreference instance inside PrefernceActivity.

    I found that Preference framework is inflexible and it’s quite hard to extend or change default behaviors, and sometimes its even impossible. But my guess is that designers of this this framework had “ease of use” as their top priority, not extendability and flexibility. Which is understandable.

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

Sidebar

Related Questions

I'm attempting to use TinyXML to read and save from memory, instead of only
We are attempting to use a SQL Server 2003 database for our test records
I'm attempting to use Redmon http://www.winimage.com/misc/redmon/ to send print jobs to a custom C#
I am attempting to use a custom font for a TextView on Android, following
I am attempting to use MapKit to create a custom map (similar to this
Attempting to use a custom hex color for my css triangle (border). However since
I'm attempting to build an application using the Salesforce API (with custom PatronManager objects)
How do you write or read to external files with custom extensions (like, instead
I'm building a custom search page and attempting to use an existing custom search
I'm attempting to write a custom widget and I want to use existing UI

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.