How to change the default color of DatePicker and TimePicker dialog in Android?

The best way to change the picker dialog is by adding custom style to it. <style name=”TimePickerTheme” parent=”Theme.AppCompat.Light.Dialog”> <item name=”colorAccent”>@color/color_primary</item> <item name=”android:layout_width”>wrap_content</item> <item name=”android:layout_height”>wrap_content</item> </style> TimePickerDialog timePicker = new TimePickerDialog(mContext, R.style.TimePickerTheme, fromListener, hour, min, false); Worked perfectly for me.

Android TimePickerDialog set max time

THIS ANSWER IS OUTDATED It will not work on Android 5 or higher. This is an extension to fiddlers answer. Somehow the onTimeChangedListener is not set by TimePickerDialog in some Android Versions: ex. http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.2.1_r1.2/android/app/TimePickerDialog.java The onTimeChanged methode therefor is never called! Best solution for this issue currently, is propably to code a custom TimePickerDialog with … Read more