Code example for TimePicker

Methods: getCurrentHourgetCurrentMinute

    private void tryNotifyDateTimeSet() { 
        if (mCallBack != null) {
            mCallBack.onDateTimeSet(mDatePicker, mTimePicker, mDatePicker.getYear(),
                    mDatePicker.getMonth(), mDatePicker.getDayOfMonth(),
                    mTimePicker.getCurrentHour(), mTimePicker.getCurrentMinute());
    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.