Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Simple Android App (2014) Basic Android Programming Adding the onClick() Method

android "cannot resolve symbol"

Hi I'm trying to run what I have so far, but I'm getting an error that says it cannot resolve my TextView or Button symbols. Its also saying it cannot resolve my setText and setOnClickListener methods

Harry James
Harry James
14,780 Points

Hey Asad!

Can you please provide a screenshot and/or a copy of your code here and me or someone else will take a look :)

Thanks in advance!

1 Answer

Steve Nelms
Steve Nelms
1,524 Points

I had this issue as well, my problem was that I had closed out the onCreate method before including the block of code with OnClickListener and setOnClickListener.

See Stack Overflow