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 with Java Creating the Screen Layout Setting Colors

Abdulraheem Bakare
Abdulraheem Bakare
809 Points

i think i placed everything the right way

i think i put everything in the right place but for some reason i wouldn't work

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/white" >

  <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>

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Abdulraheem,

You've pretty much got it. :thumbsup: There is just a small syntax/placement error.

The line android:textColor="@android:color/white needs to be part of the rules for the TextView. You have it outside of the closing /> and you have an extra >. Just move up the line to be included in the rule and delete that extra angle bracket and the rest looks good!

Nice work! :) :dizzy:

Abdulraheem Bakare
Abdulraheem Bakare
809 Points

i still tried that but its still not working can you please explain it a little clearer :)

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

You just need to move the line up. You have

android:textSize="72sp" />
    android:textColor="@android:color/white" >

You'll notice that the TextView is closed after the textSize declaration. But you have your rule after that closing tag, so it is not applied or recognized by the compiler. In fact, it should throw a syntax error.

You'll need to first delete the closing angle bracket on your line that shouldn't be there, and then move your line of code to be inside with the other rules like so:

android:textSize="72sp" 
android:textColor="@android:color/white" />

:)