I have one TextView and when I touch the TextView it will call the Date and TimePicker. First I\'am showing the DatePicker and Once I have selected date then I can set the value
DatePickerDialog dpd = new DatePickerDialog(context, mDateSetListener, myear, mmonth, mday); dpd.setCanceledOnTouchOutside(true);
Docs here