How to get date from date picker in android?

前端 未结 7 1586
眼角桃花
眼角桃花 2021-01-13 10:29

I am using the DatePicker for my application. I want to get the date that I have selected (on the DatePicker), but it\'s not returning the selected

7条回答
  •  悲&欢浪女
    2021-01-13 11:20

    Dj's answer would work. And if you want to use a calendar variable for storing the date then,

         public void onDateSet(DatePicker view, int year, int monthOfYear,
                int dayOfMonth) {
            setDate.set(year, monthOfYear, dayOfMonth);          
    

    Hope this helps!

提交回复
热议问题