[android-developers] Dynamic preferences for a variable number of profiles in an Android app

2010-08-24 Thread Unitedroad
Hi,
   I am looking for a way to create dynamic preferences where I don't
need to hard code the preference key and I could have a variable
number of preferences.
Basically, my application will let the user create a multiple number
of profiles and each of these profiles will save custom values for a
fixed number of preferences.
So this way, the user does not have to change the preferences every
time he wants this app to run differently, he can just switch the
profile.
One way I think will work is by subclassing all the standard
Preference classes and calling their setKey method with my custom
preference key, containing the profile name, but this is ugly.
So is there a cleaner and more standards compliant way to do this?
Regards,
Dhruwat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Dynamic preferences for a variable number of profiles in an Android app

2010-08-24 Thread TreKing
On Sun, Aug 22, 2010 at 9:31 AM, Unitedroad dhruwatbha...@gmail.com wrote:

 So is there a cleaner and more standards compliant way to do this?


http://developer.android.com/reference/android/content/Context.html#getSharedPreferences(java.lang.String,
int)

Look at the first parameter.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en