简体   繁体   中英

MultiSelectListPreference not showing values

I have created a MultiSelectListPreference. It does not show ANY multi-selection list, of the default_aliases. It only shows the text "Choose aliases" (dialogMessage) in the opened dialog.

    <MultiSelectListPreference
        android:title="@string/aliases"
        android:positiveButtonText="@android:string/ok" 
        android:negativeButtonText="@android:string/cancel" 
        android:dialogTitle="Aliases" 
        android:key="aliases" 
        android:dialogMessage="Choose aliases" 
        android:defaultValue="@array/default_aliases" 
        android:entryValues="@array/default_aliases" 
        android:entries="@array/default_aliases"/>

MultiSelectListPreference, being a DialogPreference, has the inherited "dialogMessage" attribute. You would think this message should be an explanation (for the user) on the selection - but NO. The dialog widget simply shows JUST the message, and totally ignores the multi-selection part.

The solution is not to supply a "dialogMessage" at all.

This is a weird behavior, and looks a bit like an Android bug. I am using api 15 (4.1).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM