Do not use Preferences for this purpose!
You should use AccountManager.setUserData() and AccountManager.getUserData() to store your things; this makes your settings safe (the AccountManager stores it), and you pass the Account , so everything is coordinated correctly, and all financial statements are executed when the user deletes accounts.
source share