Use:
Calendar.HOUR_OF_DAY
Instead of
Calendar.HOUR
Domanda
I wanna display a Time Picker in my android app but when time picker displays it display current minute and hour but it can't set that it is AM or PM.
Snapshot of the code sample used to populate time Picker
return new TimePickerDialog(this, timeSetListener,
c.get(Calendar.HOUR), c.get(Calendar.MINUTE), false);
In the above image snap of time picker which display irrespective of the current AM or PM. I want in time picker it should display that whether it is AM or PM.
Soluzione
Use:
Calendar.HOUR_OF_DAY
Instead of
Calendar.HOUR