SharedPreferences will store the value you supplied. If you want to
convert that into anything else, it is up to you.

On Wed, Jul 14, 2010 at 1:31 PM, Mookie <[email protected]> wrote:
> if i have setup as an array
>
> <string-array name="Sex">
>        <item>Male</item>
>        <item>Female</item>
> </string-array>
> <string-array name="Sex_Values">
>        <item>m</item>
>        <item>f</item>
> </string-array>
>
> and i create a shared preference as
>
> <ListPreference android:key="iama" android:title="I am a "
> android:entries="@array/Sex" android:entryValues="@array/Sex_Values"/>
>
>
> how can i have the title displayed for the entry as "I am a male"
>
>
>        public void onSharedPreferenceChanged(SharedPreferences
> sharedPreferences,String key)
>        {
>                        try
>                        {
>                        /* your code here */
>                        if (key.equalsIgnoreCase("iama"))
>                                lIma.setTitle("I am a  " +
> sharedPreferences.getString("iama","woman"));
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

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

Reply via email to