Android opening Datepicker from EditText

I'm trying to figure out how to click / focus on an EditText field and open the DatePicker - preferably instead of a keyboard, not a Dialog, but I'll take whatever for now. I would like to avoid using a TextView as the button that activates the Datepicker, if at all possible.

Because of this demographic http://developer.android.com/about/dashboards/index.html client would like versions 10 and be supported.

I've read a lot of questions about this, but so far each answer has deprecated functions (i.e. showDialog) or used functions that require API 11 (i.e. DialogFragment).

Any ideas on how to proceed? Many thanks!

+3


source to share


1 answer


If I understand your problem correctly, here is the lib that does exactly what you want (works with API level 8+):

https://github.com/robzon/android-datepicker



Also, showing the datepicker instead of the keyboard, like you would on iOS - on Android you have to show the dialog.

+2


source







All Articles