Code example for DatePicker

Methods: clearFocusgetDayOfMonthgetMonthgetYear

0
        tryNotifyDateTimeSet(); 
    } 
 
    private void tryNotifyDateTimeSet() { 
        if (mCallBack != null) {
            mDatePicker.clearFocus();
            mCallBack.onDateTimeSet(mDatePicker, mTimePicker, mDatePicker.getYear(),
                    mDatePicker.getMonth(), mDatePicker.getDayOfMonth(),
                    mTimePicker.getCurrentHour(), mTimePicker.getCurrentMinute());
        } 
    } 
 
    @Override 
    protected void onStop() { 
        if (Build.VERSION.SDK_INT >= 16) {
            // The default behavior of dialogs changed in JellyBean and onwards. 
            // Dismissing a dialog (by pressing back for example) 
            // applies the chosen date. This code is added here so that the custom 
            // pickers behave the same as the internal DatePickerDialog. 
            tryNotifyDateTimeSet(); 
Connect your IDE to all the code out there  Get Codota for Java