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 trialAbigail arias
1,508 PointsI'm getting an error(red scribble line) whenever I put an id...
I'm trying to put id to my textViews and buttons example: android:id="@+id/funfactsBox"
1 Answer
J.D. Sandifer
18,813 PointsI believe it's best practice that you do this from the design view rather than the layout XML file. This takes care of the matching up the code for you.
Just click on the design tab below the code you described, click on the TexView on the graphic representation of app on the android device and then find "id" in the text boxes on the right. You can enter the id there.
Alternatively, there should be a little red light bulb that pops up to the left of the code line if you hover your mouse over the id with the red squiggle under it. Click on the bulb and it will tell you more about the problem. It might be something simple.