I am using this code to get the time from the Time Picker. . .
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case TIME_DIALOG_ID:
return new TimePickerDialog(this,mTimeSetListener, Calendar.HOUR, Calendar.MINUTE, false);
}
return null;
}
private TimePickerDialog.OnTimeSetListener mTimeSetListener = new TimePickerDialog.OnTimeSetListener() {
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
reminderSetTime.setText(""+hourOfDay+":"+minute+"");
Toast.makeText(ImportantDateReminderActivity.this, "Time is="+hourOfDay+":"+minute, Toast.LENGTH_SHORT).show();
}
};
static final int TIME_DIALOG_ID = 0;
And to Display the TimePicker i use below code:
case R.id.reminderTime:
showDialog(TIME_DIALOG_ID);
break;
With doing that i am not getting the proper value of the time. I want the Value like 1:00 PM and 10:00 AM But i am not getting PM/AM and if the time is more then 12 then i am getting 13,14. . . like figure. instead of that i want the figure in 1 to 12.
So how to set that value ?? Thanks.