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

setText method unavailable in Intellisense

I am working through the Building a Simple Android app >> Getting Started >> Adding an OnClickListener. The problem I am running into is that the setText method isn't available (doesn't come up through intellisense). I'm wondering if there is another extension or something that I haven't downloaded. In the video there are many types of setText methods but in mine there are none. I am a complete newbie so I apologize for simple questions but any help would be appreciated.

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hi Travisse,

Can you copy all your code from MainActivity.java and paste it in here in a reply? It looks like maybe an import statement or something is missing.

Ben,

Thanks for your quick reply. The problem resolved itself tonight. I shut down Eclipse and when I opened it again it had a whole list of updates that needed to be installed. I don't know why they didn't install in the first place but it appears to have done the trick - the setText method showed up and worked just fine.

Thanks again for the help and for the teaching a great class. You guys have by far the best learn-to-code overall product that I've used thus far and I'm looking forward to learning lots more.

Actually while looking more closely at this I may not have completed the code challenge and thus didn't have the line of code: Button getAnswerButton = (Button) findViewById(R.id.button1); I'm honestly not sure because I forgot to save and had to go through the whole exercise again tonight. Anyways, just another option of what may have gone wrong.