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 (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