Skip to content Skip to sidebar Skip to footer

Why Are My Sharedpreferences Entries Not Being Cleared Upon Reinstalling?

Upon reinstalling my app the code within my if statement is being accessed despite my SharedPreferences entry not yet having been created. I'm using an emulator with eclipse, does

Solution 1:

Most likely the app is simply being reinstalled. In order for the data to be cleared, the app actually has to be uninstalled first. Reinstalling won't actually clear the data. The emulator actually allows for a runtime option that will wipe all user data when you run the emulator, but I don't believe it runs each time your run the app. You can set this option in the Run Configurations for the app if you are using eclipse.

To do it from inside the emulator, go to settings->applications->manage applications->your app->clear data

Solution 2:

A shared preference and sqlite db doesnt get removed on a reinstall. To delete them, go to Settings-->Appications-->Manage Applications-->Click on you application-->Click on "Clear Data" on emulator. this will clear the data stored.

Post a Comment for "Why Are My Sharedpreferences Entries Not Being Cleared Upon Reinstalling?"