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

Benjamin Hoopes
647 PointsAdd a Button inside this RelativeLayout. Donβt add any attributes yet.
Hi, I'm on the code challenge above and trying to add a button inside the relative layout in xml, but getting the error "Bummer! Don't forget your opening and closing Button tags (or combined as one empty tag). Make sure your Button element is inside the opening and closing tags for the RelativeLayout." My code is below, can someone please help me figure out what I'm missing?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<button
android:id="@android:id/button1"/>
</RelativeLayout>
5 Answers

James Barnett
39,199 PointsWhere is your closing button tag?

Benjamin Hoopes
647 PointsLooks like my code didn't make it, here it is:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" >
<button android:id="@android:id/button1"/>
</RelativeLayout>

Benjamin Hoopes
647 Points<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" >
<button android:id="@android:id/button1"/>
</RelativeLayout>

Benjamin Hoopes
647 PointsNot sure why the code won't show up in the forum!

James Barnett
39,199 PointsFixed the formatting on your code, make sure to check out the thread that Kevin Korte linked to.

Kevin Korte
28,149 Points
Ben Jakuben
Treehouse TeacherOne letter off! View elements in Android layout XML begin with capital letters. They are class names, essentially. :)

Benjamin Hoopes
647 PointsThank you everyone!