Andrew Andrew - 1 year ago 117
Android Question

Deleting shared preferences

How do I delete SharedPreferences data for my application?

I'm creating an application that uses a lot of web services to sync data. For testing purposes I need to wipe out some SharedPreferences values when I restart the app.

Answer Source

To remove specific values: SharedPreferences.Editor.remove() followed by a commit()

To remove them all SharedPreferences.Editor.clear() followed by a commit()

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download