当使用TimePickerDialog
时,除了第一次运行之外,一切似乎都正常工作,它假设当前的AM / PM是AM,即使它不是。
@Override
protected Dialog onCreateDialog(int id)
{
switch (id)
{
case TIME_DIALOG:
return new TimePickerDialog(this, timeSetter, hour, minute, false);
}
return null;
}
private TimePickerDialog.OnTimeSetListener timeSetter = new TimePickerDialog.OnTimeSetListener()
{
public void onTimeSet(TimePicker view, int cHour, int cMinute)
{
hour = cHour;
minute = cMinute;
}
};
一旦选择了时间,AM / PM设置在连续运行时是正确的,但我不知道如何将其设置为正确的AM / PM。帮助