Account preferences in Android 2.2 per account, not account type

I'm developing an Android application and have one account authenticator with preferences. But when I add two accounts of my type, then the preferences are shared between them. How can I define preferences, so that they could be set for each account separately?

Thanks in advance!

Przemek

Upvotes: 4

Views: 455

Answers (1)

escape-llc
escape-llc

Reputation: 1331

Do not use Preferences for this purpose!

You should be using AccountManager.setUserData() and AccountManager.getUserData() to store your stuff; this makes your settings secure (AccountManager is storing it) and you are passing the Account, so everything is matched up correctly, and all the bookkeeping is done when the user deletes accounts.

Upvotes: 1

Related Questions