code: private void fixTimePickerBug18982() {
          View amPmView = ((ViewGroup) mTimePicker.getChildAt(0)).getChildAt(3);
  
          if (amPmView instanceof NumberPicker) {
              ((NumberPicker) amPmView).setOnValueChangedListener(new OnValueChangeListener() {
  
                  @Override
                  public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
                      if (picker.getValue() == 1)  // PM
                      {
                          if (mTimePicker.getCurrentHour() < 12)
                              mTimePicker.setCurrentHour(mTimePicker.getCurrentHour() + 12);
                      } else  // AM
                      {
                          if (mTimePicker.getCurrentHour() >= 12)
                              mTimePicker.setCurrentHour(mTimePicker.getCurrentHour() - 12);
                      }
  
                      mCallback.onTimeChanged(
                              mTimePicker.getCurrentHour(),
                              mTimePicker.getCurrentMinute());
                  }
              });
          }
      }
docs: Workaround for bug in Android TimePicker where the onTimeChanged() callback
  is not invoked when the user toggles between AM/PM. But we need to be able
  to detect this in order to dynamically update the tab title properly when
  the user toggles between AM/PM.
  <p>
  Registered as Issue 18982:
  <p>
  https://code.google.com/p/android/issues/detail?id=18982