androidandroid-timepickerandroid-5.0-lollipop

Is it possible to change the style of an Android L TimePickerDialog?


I was testing my app on an Android L emulator, and I noticed that the TimePickerDialog has significantly changed to this:

Android L TimePickerDialog

This doesn't fit with the theme of my app, and I wanted to know if it is possible to get the old TimePickerDialog style when running on Android L.


Solution

  • You can use the TimePickerDialog constructor with theme parameter to specify the theme.

    TimePickerDialog(Context context, 
                     int theme, 
                     TimePickerDialog.OnTimeSetListener callBack, 
                     int hourOfDay, 
                     int minute, 
                     boolean is24HourView)