user1804590 user1804590 - 10 days ago 7
Android Question

Drawable Image gives 'No resource found..' but it is in the folder

I have the below XML in slider_button.xml:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"
android:state_pressed="false"
android:drawable="@android:drawable/button9patch" />
...
</selector>


The
android:drawable="@android:drawable/button9patch"
gets the error:


Error: No resource found that matches the given name (at 'drawable'
with value '@android:drawable/button9patch').


However I think I have the file in the right place (I've even put it in all the drawable folders to be sure):

enter image description here

What am I doing wrong? Thanks

Answer

change like this

 android:drawable="@drawable/button9patch"