Android Build a Simple Android App with Java Creating the Screen Layout Changing Text in a Layout

Nkosinolwazi Moyo
Nkosinolwazi Moyo
9,578 Points

Changing the text

I don't know, what's wrong with my coding

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

  <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="16sp" />

</RelativeLayout>

1 Answer

Tonnie Fanadez
Tonnie Fanadez
UX Design Techdegree Graduate 22,736 Points

Nkosinolwazi Moyo

Thanks for your query, You did well but I figured out there is a space between the word me and ! . Remove the space and your work will be alright.

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

  <TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
<!--   remove the space between the word me and the apostrophe-->
    android:text="Treehouse loves me!"
    android:textSize="16sp" />

</RelativeLayout>