I worked so hard to change the default background color of Lollipop\'s DatePicker. I cannot simply use Styleable attrs to change the default style. And as mentioned in anoth
Any code using reflection may break on future OS updates. You should never use reflection to access private APIs or values.
The easiest way would be to create an overlay theme that redefines android:colorAccent
and apply that to your DatePicker
.
res/values/styles.xml:
<style name="MyThemeOverlay">
<item name="android:colorAccent">@color/my_accent</item>
</style>
res/layout/my_layout.xml:
<DatePicker
...
android:theme="@style/MyThemeOverlay" />
if you want to do it programmatically without xml
, follow this link