user4625928
user4625928

Reputation:

String types not allowed (at 'background' with value )

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.

Upvotes: 0

Views: 5474

Answers (5)

Sandeep
Sandeep

Reputation: 11

try this instead.

go to values -> colour.xml and delete

color name="background">color

it worked for me

Upvotes: 1

Habeeb Rahman kalathil
Habeeb Rahman kalathil

Reputation: 101

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

Upvotes: 1

user4728480
user4728480

Reputation:

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

Upvotes: 0

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132992

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"

Upvotes: 1

Fahim
Fahim

Reputation: 12388

You cannot use @drawables/, use @drawable/

android:background="@drawable/myimagename"

Upvotes: 0

Related Questions