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!

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 Build an Interactive Story App (Retired) Finishing the User Interface Loading the First Page

Cannot resolve the symbol getText()

  1. mTextView.setText(page.getText());

  2. mChoiceButton1.setText(page.getChoice1().getText());

  3. 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

In 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
Alice Spencer
12,273 Points

I 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.

That was my mistake. I forgot to generate setter & getter methods for choice class. Now its working fine.

Thanks Alice & Danial.