質問

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);

Sample of timepicker

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.

役に立ちましたか?

解決

Use:

Calendar.HOUR_OF_DAY

Instead of

Calendar.HOUR
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top