I'm having trouble adding a image to my background, I saw a similar question earlier and none the answers helped me. Ive tried everything "@drawables/myimagename", "myimagename.png", and "myimagename" none of these things seem to work. I even tried to put in the path of the picture, and still nothing.
Asked
Active
Viewed 5,457 times
0
-
i tried that the drawable/myimage but i get this error :Rendering Problems Couldn't resolve resource @drawable/atl1.png Failed to convert @drawable/myimage into a drawable. im using a png if that matters – Apr 02 '15 at 02:47
-
guys i feel like a freaking idot, i kept putting .png after myimage (myimage.png) that fixed it. – Apr 02 '15 at 03:24
5 Answers
1
Ive tried everything "@drawables/myimagename"
To set image from drawable,drawable-mdpi,drawable-hdpi,...
folder's use @drawable/[image_name]
instead of @drawables
:
android:background="@drawable/myimagename"

ρяσѕρєя K
- 132,198
- 53
- 198
- 213
1
you must want that folder name drawable and you also call it like
android:background="@drawable/myimagename"
and the name myimagename
must be typed like in the file name in the folder

Evgeniy Mishustin
- 3,343
- 3
- 42
- 81

Habeeb Rahman kalathil
- 101
- 1
- 7
1
try this instead.
go to values -> colour.xml and delete
color name="background">color
it worked for me

Sandeep
- 11
- 2
0
You cannot use @drawables/
, use @drawable/
android:background="@drawable/myimagename"

Fahim
- 12,198
- 5
- 39
- 57
0
You need to use this
@drawable/myimagename
instead of
@drawables/myimagename
Make sure you have the image named myimagename in the drawable folder of your application