Question

I'm trying to create an option menu in my preferences but I can't get the options to display. When I select the option in the prefs menu I got an empty pop up dialog (title at the top, button at the bottom, but no options).

This is what I do: I create an array.xml file in res/values

<?xml version="1.0" encoding="utf-8"?>
 <resources>
 <string-array name="listArray">
 <item>3</item>
 <item>5</item>
 <item>7</item>
 <item>10</item>
 <item>15</item>
 <item>20</item>
 </string-array>

<string-array name="listValues">
 <item>3</item>
 <item>5</item>
 <item>7</item>
 <item>10</item>
 <item>15</item>
 <item>20</item>
</string-array>   

and in m prefs.xml i have:

<ListPreference 
    android:dialogTitle="@string/prefsMaxAdAge"
    android:dialogMessage="@string/prefsMaxAdAgeSummary" 
    android:key="itemMaxAdAge"
    android:title="@string/prefsMaxAdAge" 
    android:summary="@string/prefsMaxAdAgeSummary"
    android:entryValues="@array/listValues" 
    android:entries="@array/listArray">
</ListPreference>

Any help would be much appreciated! Thank you!

Was it helpful?

Solution

I finally found the solution to that problem. The XML field DialogMsg must not be set. This makes sense after all. Useful help was found here: http://code.google.com/p/android/issues/detail?id=4497

OTHER TIPS

ListPreferences seem to appear empty whenever they contain a dialogMessage. As to why, I would very much like to know the answer...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top