Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (2014) Creating the Screen Layout Setting Colors

Where do i put the color code in the background layout

Now let's change the background color of the whole RelativeLayout to a dark pink. Use the code #fff092b0..

Is this what you tried for an answer: android:textColor="@android:color/white" ?

That was for the first one yes but the second one wants dark pink i put where is says android:background="@android:color/white" i put the #fff092b0 where the white is so it said android:background="@android:color/#fff092b0 but still says its wrong.. idk where to put the color code at to change the background color from white to dark pink

3 Answers

You just need to drop out the @android:color/ part. That is for referencing colors that are pre-defined in the Android system, like "white", "black", "yellow", etc.

android:background="#fff092b0"

thanks for the answer

Why do we drop the @android part of the code though? I thought that @android was a standard part of the XML language....it works to drop it, but it seems to go against what little I know about programming languages consistency.