Question

If I add a ListPreference in my settings.xml the framework shows a list-entry that when clicked shows a list of options. Is it possible to show the list "inline" I mean without making the user having to click on the entry to see the list?

What I need is to show the current selected option and then when the user clicks on it, hte list of all the available options to allow the user to pick another one.

I found this example but I wonder how my HTC can show a combo in the Accessibility settings (for "Touch & hold delay").

Was it helpful?

Solution

You need to subclass Preference and make it behave like a Spinner or a ListView. Either that, or you can set the android:layout attribute of the <Preference> tag in the XML to return a layout which contains a ListView. Check this question.

OTHER TIPS

Use Spinner widget. Check documentation here.

Check out this post How do I display the current value of an Android Preference in the Preference summary?

The bottom line is that you need to register a change listener for the preference and manually update the Summary (second line) of the ListPreference using the selected value from the List. The link provides all the information and samples on how do it.

Also, Some people report that using android:summary="%s" works, but I've never gotten that to work in 2.x.

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