Search code examples
androidlayoutviewandroid-datepicker

Android DatePicker like Android Calendar app


I am trying to implement an activity where I want the user to put a date information.

I would like it to look like the Android Calendar App. Their button looks like a spinner, but with the selected date (picture 1). When the button is clicked, it opens the Date Picker dialog (picture 2).

http://pineapple.cc/datepicker1.png

http://pineapple.cc/datepicker2.png

Should I use a redesigned button, spinner, textview ?

Thank you a lot for you help


Solution

  • Does the supplied widget not do it for you? Ooops misunderstood question. Disregard.

    Edit:

    I'm looking at the EditEventView activity in the Calendar app, and they're using a button that launches the DatePicker widget. The setDate() method there does the formatting.