Android Build a Simple Android App with Java Creating the Screen Layout Setting Colors

Troy Machado
PRO
Troy Machado
Pro Student 570 Points

Background color will not change in Android Studio 3.0.1

No matter what I do, whether I use the color code or the pre-loaded color, the background will not change. I have had a lot of issues with this version and want to know if it is just a bug or if I am doing something wrong.

Ben Deitch
Ben Deitch
Treehouse Teacher

Sounds like a bug. Though if you'd like, post your XML layout and I can double check it.

Melanie Myers
Melanie Myers
9,154 Points

It seems like Studio is trying to make you stick to colors in a theme. You'll need to add the color to the project by going to res -> values -> colors.xml. Duplicate one of the existing color lines and modify for the background color.

Then go back to the layout where you are trying to set the color and click the ... next to background. Go to "Color" on the left and under project you should see the color you just added.

There may be an easier way to do it, but this is how I got it to work :)