Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpinnerPreference? (How to embed a Spinner in a Preferences screen)

Planting a Spinner in a layout is straightforward, since there are so many samples and tutorials showing how to do just this.

But how to I plant a Spinner in a PreferenceScreen?

Is this possible/doable at all?

Note: I have already conducted an extensive search. There is no such thing as a "SpinnerPreference". I wish there were.

like image 657
uTubeFan Avatar asked May 16 '13 00:05

uTubeFan


1 Answers

You can create a custom Preference by extending the Preference class or DialogPreference class. There is an example in the Settings guide on developer.android.com.

Alternately you might want to consider using a ListPreference. The user gets to pick one value from a list of values. The UI is similar to the images in the tutorial you linked to.

like image 62
LordRaydenMK Avatar answered Oct 13 '22 03:10

LordRaydenMK