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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:33:36+00:00 2026-05-19T14:33:36+00:00

I have noticed that my app’s SharedPreferences are completely reset if the app is

  • 0

I have noticed that my app’s SharedPreferences are completely reset if the app is force closed or is killed by the system for some reason. Obviously, yes, I should avoid having a crash in the first place but it does happen. If it does happen, the user shouldn’t loss all of their settings and other data stored with the Preferences.

I found this thread on Google Groups but they couldn’t solve it.

Anyone have any insight into why or how this happens and if there is a way to prevent it?

Also, fyi I have seen this on a 2.1 and a 2.2 device. It will happen on every crash, not just some of them.

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-19T14:33:37+00:00Added an answer on May 19, 2026 at 2:33 pm

    After some digging around I finally discovered the source of the problem. Through an error in my code, a string preference was getting saved with a null key. So after the crash when it went to load the Preferences there was a blank in the preferences xml file which caused the preferences to crash and be reset. For some reason I was not getting the stack trace of the preference crash, only the immediate cause of the initial crash.

    Just to add some more details in case someone else has a similar problem in the future:

    The xml file that has the preferences stayed intact up to and through the force close button press. The next time the shared preferences were accessed however, the xml file was cleared and started anew.

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

Sidebar

Related Questions

I have noticed that after my Grails app has been deployed for about 2
I have been using Wireshark and I noticed that my plugin seem to track
I just uploaded a beta of my app to http://testflightapp.com . I noticed that
I have a little web app that uses the Facebook like widget. This page
I have a Flex application here If you open that link, you'll see it
I have a small web application developed using Icefaces 1.8.2 and jsf 1.1 which
I am in the design stages of an app involving QR codes. It will
I had an epiphany just now. In some places in my very first iPhone
We are using Rails 3.0.X and running our web app on Heroku. We are
I'm quite new to Android development and was about to finish my first application

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.