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 trial

Android Build a Simple Android App Basic Android Programming Adding the OnClick Method

Hyejin Yoon
Hyejin Yoon
133 Points

I get the Error. Error:(51, 32) error: cannot find symbol method setText(String) for mFactTextView =setText(fact).

i run the app. it keeps giving me an error on the line, mFactTextView =setText(fact); Error message :cannot find symbol method. i tried on compilers to type bug , but it still did not work. Is there any other solutions to it?

1 Answer

Hyejin,

I see what you're trying to do here. So the statement mFactTextView =setText(fact); is actually setting setText(fact) value to a variable mFactTextView.

What it should have been was

mFactTextView.setText(fact);

setText is a function on the TextView and not a standalone property that you can assign value to. Just a typo error I guess. Change it and compile should be ok.