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

Josh Myers
Josh Myers
3,203 Points

Setting Color Activity

I'm unable to complete the second part of the exercise. It tells me to change the background of the layout to dark pink (#fff092b0). I copy and paste the hex color code into the "android:background="@android:color/white" >" line and it keeps telling me that it is incorrect. What should I do?

2 Answers

Hi, changing the color of a backround (xml) to dark pink (#fff092b0) will look like this: android:background="#fff092b0";

using "@android:color/" will give you saved system colors.

This line of xml:

android:background="@android:color/white -> will set the color to be what defined as white.

So you mush put the color code inside "", and make sure you have a # before it (also inside the "").

android:background="#any_color_code_you_want"

android:background="@android:color/_pre_defined_colors(by android)"

Dan Someone
Dan Someone
1,320 Points

Thank you for this answer. It actually was not clear in the video that the @android:color portion needed to be removed to allow the hex.