android-datepicker

Datepicker: How to popup datepicker when click on edittext

笑着哭i 提交于 2019-11-26 02:15:44
问题 I want to show datepicker popup window. I have found some examples but i am not getting it properly. I have one edittext and i want that when i click on edittext the datepicker dialog should popup and after setting the date, the date should show in edittext in dd/mm/yyyy format. PLease provide me sample code or good links. 回答1: Try this in the XML file: <EditText android:id="@+id/Birthday" custom:font="@string/font_avenir_book" android:clickable="true" android:editable="false" android:hint="

How set maximum date in datepicker dialog in android?

岁酱吖の 提交于 2019-11-26 00:48:07
问题 In my application am using date picker to set date.i want to set date picker maximum date is as today date according to system date.i don\'t know how to set date picker maximum date as today date.Can any one know help me to solve this problem. My date picker coding is: private int pYear; private int pMonth; private int pDay; static final int DATE_DIALOG_ID = 0; final Calendar c = Calendar.getInstance(); pYear = c.get(Calendar.YEAR); pMonth = c.get(Calendar.MONTH); pDay = c.get(Calendar.DAY_OF