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

1

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.

Estrogen answered 16/5, 2013 at 0:31 Comment(0)
G
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.

Germin answered 1/7, 2014 at 13:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.