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

I tried your suggestion admerson its still is not working

Check what I did and advise

activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@android:color/black" >

  <TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="Treehouse loves me!"
    android:textSize="72sp" />
    android:textColor="@android:color/white" >

</RelativeLayout>

5 Answers

Daniel Hartin
Daniel Hartin
18,106 Points

Not sure what the original question was but I think in your code you have put the closing tag a line too early try the code below.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@android:color/black" >

  <TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="Treehouse loves me!"
    android:textSize="72sp"
    android:background="@android:color/white"/>

</RelativeLayout>

Daniel seems the code you are giving is similar to what I did or am missing something

Daniel Hartin
Daniel Hartin
18,106 Points

Yes it is very similar there is only one subtle difference, if you look at the last two lines of your code you will see the closing tag is blanking the line out which defines the background colour of the textview. I simply moved this onto the last line which is where I think it should be however your question doesn't state what your original problem was so let me know if it is something further.

Hope it helps Daniel

    android:textColor = "@android:color/black"    ```
add that in the <TextView attribute.

Munya , did you work it out , if yes , can you tell me how you got around it . am stuck

hey, post the question.

I did and it worked out

Frank what challenge are you facing you can post it on the forum