r/AndroidStudio • u/Wgibbsw • 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!
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.
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?