TimePickerDialog and AM or PM

Posted by martinjd on Stack Overflow See other posts from Stack Overflow or by martinjd
Published on 2010-04-17T20:33:07Z Indexed on 2010/04/17 21:33 UTC
Read the original article Hit count: 283

Filed under:
|

I have a TimePickerDialog with is24Hour set to false since I want to present the end-user with the more familiar 12 hour format. When the hour, minute and AM PM indicator are set and the time is returned how can I identify whether the end-user has selected AM or PM?

This is what I have for the listener:

private TimePickerDialog.OnTimeSetListener mTimeSetListener =
  new TimePickerDialog.OnTimeSetListener() {

@Override
public void onTimeSet(TimePicker view, int hourOfDay, 
  int minute) {
 mHour = hourOfDay;
 mMinute = minute;
// mIsAM = WHERE CAN I GET THIS VALUE
}

};

© Stack Overflow or respective owner

Related posts about android

Related posts about timepicker