Search code examples
androidandroid-studioimageviewandroid-drawable

Android studio can not detect the source file in res/drawable


This is my code. I don't know how to post this image.

this is my code. i don't know how to post this image

I tried to add source file for my ImageView. But it doesn't work. I tried to copy the path folder and it is still not work.


Solution

  • Solution - first problem

    The resource name must start with a letter (not number).

    Solution - second problem

    Use just:

    @drawable/039_cloud
    

    instead

    @drawable/039_cloud/039_cloud
    

    so:

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/039_cloud" />
    

    Android Studio

    Android Studio is grouping same images, but for different DPIs.

    When you choose Android view, you will have:

    enter image description here

    But when you will choose Project you will see "real" project structure:

    enter image description here