Drawable Resource Not Found

后端 未结 5 1930
梦谈多话
梦谈多话 2021-02-19 06:37

All I am attempting to implement a selector drawable resource for a custom ArrayAdapter. I am consistently getting a android.content.res.Resources$NotFoundExc

相关标签:
5条回答
  • 2021-02-19 06:58

    See if what @Nebraska has suggested helps.

    Else, try this:

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android" >
        <item android:state_checked="true" android:drawable="@android:color/white" />
        <item android:state_checked="false" android:drawable="@android:color/black" />
    </selector>
    
    0 讨论(0)
  • 2021-02-19 07:16

    First of all, put them in the hdpi folder, and then clean the project. It will update everything and the error should be gone.

    0 讨论(0)
  • 2021-02-19 07:16

    I encounter a similar issue, I was able to fix it by removing a blank line at top of a .xml drawable.

    0 讨论(0)
  • 2021-02-19 07:17

    An alternate solution is I moved the XML drawables to the drawable/ folder and it worked perfectly fine for me. You might want to give it a try.

    VectorDrawableCompat Resources$NotFoundException on KitKat and below

    0 讨论(0)
  • 2021-02-19 07:20

    For me the confusion was that I had replaced all instances of a vector drawable with png, except for one, and this is what was failing. make sure and check all instances of the resource that is giving you the issue, and that all is as expected...

    0 讨论(0)
提交回复
热议问题