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 trialthomas mbuzwa
5,233 PointsfactTextView =(TextView) findViewById(R.id.factTextView); showFactButton=(Button) findViewById(R.id.showFactButton);
can anyone help this code is saying cannot resolve symbol 'factTextView'. it is showing red text (Android track)
2 Answers
Lauren Moineau
9,483 PointsHi Thomas. Did you declare your 2 variables at the top of the class (under the class name)?
private TextView factTextView;
private Button showFactButton;
If you have, then just paste your code here so we can help you further. Thanks :)
Seth Kroger
56,414 PointsAlso, if the red text is for the R.id.factTextView part make sure the id in the layout file is spelled correctly and that there are no errors in the XML.
thomas mbuzwa
5,233 Pointsthank you
thomas mbuzwa
5,233 Pointsthomas mbuzwa
5,233 Pointsthanks it worked
Lauren Moineau
9,483 PointsLauren Moineau
9,483 PointsGreat. I'm glad to hear it :)