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

Getting an error on: @+id/

It gives me a resource not found error, something like that everytime i want to i leave the id like that. "Validates

I have no clue what you are trying to ask (From next time also please share your code (or snippet) if you really want help).

Why would you not assign an id to a resource?

The correct way of assigning an id to a layout element is like this:

<!-- []  =  Optional --> 
<SomeViewWidget 
       android:id="@[+][package:]id/resource_name" 
        android:layout_height=["dimension" | "fill_parent" | "wrap_content"]
        android:layout_width=["dimension" | "fill_parent" | "wrap_content"]
        [View-specific attributes] >
</SomeViewWidget>

2 Answers

Hello,

By leaving an id as @+id/ you are essentially trying to give it no id which cannot be done. All you need to do is complete the id statement with @+id/someUniqueName.

thanks james, i had to uncheck some other things to get it right. But main thing was like that.