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 trialAkhila Mobin
4,492 PointsCannot resolve the symbol getText()
mTextView.setText(page.getText());
mChoiceButton1.setText(page.getChoice1().getText());
mChoiceButton2.setText(page.getChoice2().getText());
for the first line getText() method worked properly. But for the 2nd and 3rd line, it showing Cannot resolve the symbol getText().
Anyone face the same problem..? please help.
3 Answers
Danial Goodwin
13,247 PointsIn order to resolve the "symbol" or method name, it must be spelled the same and not private. So, in your Choice
class, make sure that getText()
is spelled exactly like that and the visibility modifier is public
.
Alice Spencer
12,273 PointsI know this may sound silly, but what worked for me when I had this problem was to delete, start retyping and then using auto-complete. Not sure what's going on "behind the scenes" so to speak to make that work, but it did for me.
Akhila Mobin
4,492 PointsThat was my mistake. I forgot to generate setter & getter methods for choice class. Now its working fine.
Thanks Alice & Danial.