I've copied a file from the Google IO Schedule app source (https://github.com/google/iosched) namely
selected_navdrawer_item_background.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/backgroundColor">
<shape>
<solid android:color="#12000000" />
</shape>
</item>
<item android:drawable="?android:selectableItemBackground"/>
</layer-list>
I want to use this to highlight the currently selected item in a NavigationDrawer. My problem is, when I launch my app, it throws an exception.
This is the important line I think.
caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #22:
<item> tag requires a 'drawable' attribute or child tag defining a drawable
Line # 22 is this one
<item android:drawable="?android:selectableItemBackground"/>
I don't know what the problem is, I copied this over from source without adjusting it. It's working fine in their app.
I tried to change ?android:selectableItemBackground
to ?attr/selectableItemBackground
, but it gives me the same exception.
I can't seem to find any other suggested solutions.
If anyone knows what's causing this, please help me.