Search code examples
androidandroid-datepicker

How to customize date/time picker in android?


I can create such dialog using AlertDialog library, however I want to use same kind of input for height and weight. Creating a custom dialog will need implementing many things such as 'sliding to change the value'. How should I edit the values in existing picker?

Date Picker


Solution

  • The DatePickerDialog dialog contains three NumberPicker widgets under the hood.

    All you have to do is create an AlertDialog with custom view containing a single NumberPicker widget. The display and sliding is provided by the NumberPicker widget. You can set min value, max value, default value etc...