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.

uTubeFan
  • 6,664
  • 12
  • 41
  • 65

1 Answers1

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.

LordRaydenMK
  • 13,074
  • 5
  • 50
  • 56