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 Changing Text in a Layout

Thomas Parmeter
Thomas Parmeter
205 Points

treehouse loves me?

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.nakie.funfactsactivity.FunFactsActivity">

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

i have changed it to treehouse loves me and it is not working when i check work

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="I love Treehouse!"
    android:textSize="16sp" />

</RelativeLayout>

Are you sure that you are not doing something wrong? Because I just clicked on the "View Challenge" and literally changed the text and It worked fine for me.

Thomas Parmeter
Thomas Parmeter
205 Points

I'm really not sure at this point as this is my first small thing i've attempted on here. i assume somehow treehouse reads the open android studio project, so i just clicked check and it says "make sure you change the text, i've even copied exactly and pasted the lines and it doesnt work.

Thomas Parmeter
Thomas Parmeter
205 Points

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.nakie.funfactsactivity.FunFactsActivity">

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

This is exactly what I have in my project.

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Thomas. Welcome to Treehouse! :wave:

If what you have above is exactly what you have in the Challenge, then there is way too much code. If you are copying and pasting from Workspaces or an IDE based on the course videos, then the challenge will often fail as it is often just a bit different than the videos. Challenges are very specific and extremely picky. You'll find that instructions need to be followed explicitly or you will end up with a Bummer.

Here, only one thing should be changed in the challenge (No other code should be added). The instructions say to just "Change the text" and that's it. So, in the preloaded code for the challenge (also a good idea to remember to never add, alter, or delete any code that is preloaded unless specifically instructed to do so), it seems you've added a few lines to the Relative Layout.

So, you'll just need to reset the challenge to the original preloaded code and only change the text "I love Treehouse" to "Treehouse loves me!". Don't change, add, or alter anything else, and it will pass.

Keep Coding! :)

:dizzy:

Thomas Parmeter
Thomas Parmeter
205 Points

well i followed the instructions. it doesnt give any good feedback on what the problem is or how to fix it. so im just sitting here like... nothing is working

Thomas Parmeter
Thomas Parmeter
205 Points

oh, i'm an idiot... i didn't know you could type in the websites code box.... haha. i thought i was supposed to code it into my Android Studio project...