8

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.

1 Answer 1

5

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.