My list preference code is shown below. The list of values has 7
choices and I'm setting the default value in one case to 2 (3rd item
in list) and the other case to 3 (4th item in list). However, when the
list preference is shown for the first time, none of the choices is
selected. Am I doing something wrong?

                                    <PreferenceScreen
                                                
android:title="@string/preferences_light_title"
                                                
android:summary="@string/preferences_light_summary"
                                                
android:key="light_preferencescreen">
                                                        <PreferenceCategory 
android:title="@string/
preferences_light_settings_title" android:summary=""
android:key="LightSettings">
                                                                <ListPreference 
android:key="minLight"
android:summary="@string/preferences_min_light_summary"
android:title="@string/preferences_min_light_title"
android:persistent="true" android:dialogTitle="@string/
preferences_min_light_dialog_title" android:entryValues="@array/
preferences_light_list_values" android:entries="@array/
preferences_light_list_entries" android:defaultValue="2"></
ListPreference>
                                                                <ListPreference 
android:key="maxLight"
android:summary="@string/preferences_max_light_summary"
android:title="@string/preferences_max_light_title"
android:persistent="true" android:dialogTitle="@string/
preferences_max_light_dialog_title" android:entryValues="@array/
preferences_light_list_values" android:entries="@array/
preferences_light_list_entries" android:defaultValue="3"></
ListPreference>
                                                </PreferenceCategory>
                                        </PreferenceScreen>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to