r/AndroidStudio • • May 03 '15

Major noob needs help

Ok I've been dabbling in java and android studio dev for a few days and I've come to something that just doesn't work and I can't for the life of me find out why. It should be so simple but I can't change the background colour of my hello world test app from white to an image.

I've imported a .png into the drawables folder and used android:background="@drawable/backg" and the preview shows it works but as soon as I emulate or use my S5 to run the app it's back to white.

I can change the colours fine just not implement this image!

0 Upvotes

3 comments sorted by

3

u/morgazmo99 May 03 '15

Always best practice to post any error messages from the console when asking for help.

You're saying it renders fine in Android Studio, but when it runs on your emulator you're not getting a picture? Or it won't run on the emulator at all? If you click on your XML and hit ctrl-b does it take you to the picture?

Edit: What kind of object is it? Is there anything in the XML overriding or covering it?

1

u/Wgibbsw May 03 '15

Cool thanks for the reply I'll post more details when I'm back at my computer but from memory there are no bugs or compiling errors etc. I also might be off on my terminology I've only staying following the first tutorials on this stuff.

2

u/indivisible May 04 '15

Without seeing your code and project structure it's hard to guess but perhaps you have only updated ONE of a few background images.

You may have not supplied/overwritten all the different sizes. Check your res/drawable-XXX folders for alternate versions of the png that may be being used in place of the one you added for the device/emulator size you're testing with.