I am using a TimePicker in my app. Whenever the user opens the screen with the TimePicker, I initialize it with the current time. When I do this, the TimePicker shows AM ins
public void onTimeSet(TimePickerDialog view, int hourOfDay, int minute) {
if(hourOfDay>=0 && hourOfDay<12){
time = hourOfDay + " : " + minute + " AM";
} else {
if(hourOfDay == 12){
time = hourOfDay + " : " + minute + "PM";
} else{
hourOfDay = hourOfDay -12;
time = hourOfDay + " : " + minute + "PM";
}
}
deliveryTime.setText(time);
}