5

I'm looking to make a basic picker in Android that looks like the built-in date and time pickers but uses a custom array of strings instead of dates and times:

enter image description here

http://developer.android.com/guide/topics/ui/controls/pickers.html

This is probably one of the most basic questions and I see lots of custom pickers and wheels floating around, but I would particularly want this to have the same look and feel as the built-in pickers. What is the best way to do this?

Edit: so I'm using TimePicker widget to display a time selector, but what can I use to select from a list of arbitrary strings instead?

SaltyNuts
  • 5,068
  • 8
  • 48
  • 80

1 Answers1

8

The look and feel comes from android.widget.NumberPicker

<NumberPicker
    android:id="@+id/numberPicker1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
appsroxcom
  • 2,821
  • 13
  • 17
  • 3
    It's actually even simpler than that, apparently just using `String[] values = .....; picker.setDisplayedValues(values);` will do the trick, where `picker` is a `NumberPicker`. – SaltyNuts Apr 16 '13 at 22:02