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

Handling a Lack of Data code challenge

<Button>
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
      </Button>

For some reason it is bringing up the error message Bummer! Make sure both 'android:layout_width' and 'android:layout_height' attributes are added to your Button element, and that you have double quotes around the values.

I thought i was doing it right am i making a mistake ?

hlias kantzos
hlias kantzos
19,191 Points

add your code to Button element
<Button your code />

1 Answer

Tunde Adegoroye you are very close!

Your code:

<Button>
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
      </Button>

The correct way to add the attributes is to add them inside of the opening <Button> tag, like so:

      <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
      </Button>

As you can see, simply moving the > over to the end of the declaration of attributes, your code is valid and passes the second part of the challenge. Keep coding!