ListPreference

Typical xml code for list preference entry (using colours as dummy data).

    <ListPreference
        android:defaultValue="@bool/pref_list_default" // Default value from list
        android:key="@string/pref_list_key" // Key name to identify preference
        android:entries="@string/pref_list_entries" // Array with all the option labels
        android:entryValues="@string/pref_list_entry_values" // Array with all the values
        android:title="@string/pref_list_label" /> // Label for preference

In strings.xml (note that keys and values should always be 'translatable: false'):

    <string name="pref_list_label">Colour</string>
    <string name="pref_list_label_red">Red</string>
    <string name="pref_list_label_blue">Blue</string>
    <string name="pref_list_label_green">Green</string>
    <string name="pref_list_value_red" translatable="false">red</string>
    <string name="pref_list_value_blue" translatable="false">blue</string>
    <string name="pref_list_value_green" translatable="false">green</string>
    <string name="pref_list_default" translatable="false">red</string>
    <string name="pref_list_key" translatable="false">color</string>

In arrays.xml:

<resources>
    <array name="pref_list_entries">
        <item>@string/pref_color_label_red</item>
        <item>@string/pref_color_label_blue</item>
        <item>@string/pref_color_label_green</item>
    </array>
    <array name="pref_list_entry_values">
        <item>@string/pref_color_value_red</item>
        <item>@string/pref_color_value_blue</item>
        <item>@string/pref_color_value_green</item>
    </array>
</resources>