Search code examples
androiddatepickerandroid-appcompatmaterial-designandroid-datepicker

Datepicker not working with appcompat v21.0.3


I'm using the appcompat v7 support library in my Android Application. Whenever I add DatePicker in my XML file it gives me an error: "android.content.res.Resources$NotFoundException". However, the timePicker is working fine. I'm using the Theme.AppCompat.Light inside my app.

The style I'm using is as follows:

<style name="MyThemeAppCompat" parent="Theme.AppCompat.Light">
    <item name="colorPrimary">@color/primary</item>
    <item name="colorPrimaryDark">@color/status_bar</item>
    <item name="colorAccent">@color/accent</item>
    <item name="windowActionBar">false</item>
</style>

This error pops up in any Android Application Project with AppCompat v7 and the same theme as shown above.

How can I use DatePicker inside my application with AppCompat?


Solution

  • Eclipse was showing the error in the graphical layout section of XML editor but, when I launched the app on my phone the DatePicker was working perfectly.