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 trialDavid O'Donohue
1,138 PointsAndroid ID
When I try to run or save the project from this point, I get an error:
android:id="@+id/"
under the second tag. I didn't add or change this line. What does it mean?
1 Answer
Jon Kussmann
Courses Plus Student 7,254 PointsLet's say in a layout file you have several TextViews. You want to be able to distinguish between them. You do so by giving each one a unique ID. That is the format for giving the ID.
You just have to fill in the name you want for the TextView like so:
android:id="@+id/firstTextView"
You can get an error if you leave it blank like you have above.