I'm currently building an app targeting API 23, with a minimum API 16. I'm facing an issue where a TimePicker is displayed within an AlertDialog. The display looks fine on Portrait mode and on Landscape mode when launching the app on Nexus 5 API <=22. However, when launching the app on a Nexus 5 API 23, the landscape mode does not correctly display the TimePicker widget, it displays only its background colors.
On Nexus 5 API 23 (Portrait): TimePicker on Portrait mode (API 23)
On Nexus 5 API 23 (Landscape): TimePicker on Landscape mode (API 23)
You have to remove set title from time picker dialogue after that you will see time picker dialogue in Nexus 5. This issue is posted on google forum see below link :
https://code.google.com/p/android/issues/detail?id=201766
TimePickerDialog mTimePicker;
String[] time = txtTimeWriteOut.getText().toString().trim().split(":");
int hour = Integer.parseInt(time[0]);
int minute = Integer.parseInt(time[1]);
mTimePicker = new TimePickerDialog(this, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
txtTimeWriteOut.setText(TimeUtils.getDoubleDigits(selectedHour) + ":" + TimeUtils.getDoubleDigits(selectedMinute));
passTimeOut = currentDate + TimeUtils.getDoubleDigits(selectedHour) + TimeUtils.getDoubleDigits(selectedMinute) + "00";
}
}, hour, minute, true);
// mTimePicker.setTitle("Select Time");
mTimePicker.show();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With