Avijeet
Avijeet

Reputation: 1051

Is sharedPreference cleared when an android app is reinstalled?

When we run an app during development on a device is sharedPreference cleared when app is reinstalled ?

Upvotes: 5

Views: 2075

Answers (3)

Akash
Akash

Reputation: 711

If you will clear the data of an application then the shared preference will be cleared hence if you reinstall an application for the first time there will be no application data so no shared preference will be there.

Upvotes: 0

Sukumar Nagarajan
Sukumar Nagarajan

Reputation: 534

while reinstalling the app,shared preference never clear. While un installed and installing the app. Shared preference get cleared.

Upvotes: 0

Yash Sampat
Yash Sampat

Reputation: 30611

  • If the app is manually uninstalled first and then reinstalled, then yes, SharedPreferences and SQLite tables of the old installation are deleted.
  • If the app is updated from the Play Store or re-run from the IDE without uninstalling the previous version of app first, then SharedPreferences and SQLite tables of the old installation are still present.

Upvotes: 8

Related Questions