I want to add some message in a ListPreference dialog, so I thought about using the attribute android:dialogMessage.
However, when I set this attribute, the list entries (set with android:entries and android:entryValues) are not shown anymore in the dialog (It seems to be a known bug as I could read about it elsewhere).
So it seems that I may need to make a special custom ListPreference in order to show both the dialogMessage and the list entries.
I consider creating a custom class MyListPreference that would be slightly modified for this purpose. I would override onCreateDialogView() to make the changes. However I'm a bit unsure about the cleanest changes to make as I can see two alternatives:
Alternative 1- Create a custom XML layout I would copy the default xml layout for the ListPreference dialog and add a textView. In onCreateDialogView() I would inflate this custom layout.
Alternative 2- Modify the View on the fly In onCreateDialogView() I would call super.onCreateDialogView() and dynamically add a textView to the view it returns.
Question: What do you recommend doing? If alternative 1 is the best, where can I find the default XML layout for the ListPreference dialog so that I can customize it?
Thank you for your help