I am getting the following stack trace only in pre lollipop devices. This happens only when I use "?attr/border_color" kind of syntax in the drawable xml. If I hardcode a color, it works.
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/border_not_left.xml from drawable resource ID #0x7f020042
at android.content.res.Resources.loadDrawable(Resources.java:2235)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.view.View.<init>(View.java:3561)
at android.widget.TextView.<init>(TextView.java:623)
at android.widget.TextView.<init>(TextView.java:618)
border_not_left.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="?attr/border_color" />
</shape>
</item>
<item android:bottom="1dp" android:right="1dp" android:top="1dp" >
<shape android:shape="rectangle">
<solid android:color="?attr/border_inside_color" />
</shape>
</item>
</layer-list>
styles.xml
<style name="MaterialAppTheme" parent="MaterialAppTheme.Base">
</style>
<style name="MaterialAppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="border_color">@color/black</item>
<item name="border_inside_color">@color/border_background_light</item>
<!--<item name="textColorPrimary">@color/textColorPrimary</item>-->
<!--<item name="windowBackground">@color/windowBackground</item>-->
<!--<item name="navigationBarColor">@color/navigationBarColor</item>-->
</style>
<style name="DarkBgLightBorderTheme" parent="MaterialAppTheme.Base">
<item name="border_inside_color">@color/background_dark</item>
<item name="border_color">@color/LightGrey</item>
</style>
No comments:
Post a Comment