Where should I put a PNG file in ImageButton in Android?

I am very new to Android.

I created ImageButton. The main .xml includes a code segment as follows.

<ImageButton android:id="@+id/button1" android:layout_width="50px" android:layout_height="50px" android:src="@drawable/cat" android:layout_x="50px" android:layout_y="52px" > 

Where do I need to put "cat.png", which I have. Do I need to rename it to another?

+4
source share
2 answers

Put it in the res/drawable/ folder in your Android project. Save the name cat.png

+2
source

you can simply insert any folder for which you will not need to change xml.

0
source

Source: https://habr.com/ru/post/1342109/


All Articles