How can I show data picker in android?

116 views Asked by At

I am building an android application where user set it date.

I need is that when user click on an button an notification or dialog-box open and there the user set the data and the value that the user had select is displayed to an text-view in order like 23/feb/2014.

1

There are 1 answers

0
hejho On

These are the things you will need to do:

  • Create custom Dialog or Activity with xml styling
  • To this xml add DatePicker view and a Button
  • Start an Intent with a Result that can be picked up by your MainActivity
  • In the Result pass your parameters to the MainActivity (date and so on)
  • In your MainActivity parse the data you got from the date picker dialog. To do this, use findViewById() method, then on the TextView use method setText().

Hope it will give you a good starting point.