Friday, January 4, 2013

[android-developers] Re: Defining a ListPreference

on string-array, it is expect to have string values. you have to do some java code to set theme then restarts the activity.

On Friday, January 4, 2013 5:15:36 PM UTC-5, dashman wrote:
I've got a ListPreference

    <ListPreference
        android:key="themes_pref"
        android:entries="@array/Themes"
        android:entryValues="@array/ThemesValues" />

The entryValues points to an array, defined as:

   <string-array name="ThemesValues">
        <item>@style/AppBaseThemeLight</item>
        <item>@style/AppBaseThemeDark</item>
    </string-array>

I'm trying to get the array to hold the constant values for the given themes.

Defined as:

    <style name="AppBaseThemeDark" parent="android:style/Theme.Holo">



The program compiles - but when I run and click to open the ListPreference
- it crashes with a null pointer exception interpreting the array

If I replace the item entries with @styles with a string - it works.





--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate