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 with Java Basic Android Programming Accessing Views in Code: Declaring Variables

Collin Bottomlee
Collin Bottomlee
553 Points

Alt+Enter not working to import TextView?

At about 3:20 in the video, Ben says to hit Alt+Enter to import the TextView into the Java code. I repeated those steps and nothing happened. I read another question where someone else had a similar problem, but the answers to that didn't lead me anywhere, not sure what to do.

5 Answers

Dávid Cichý
Dávid Cichý
1,201 Points

If alt+enter doesn't work for you just open "import" with the little + and copy paste there this: import android.widget.Button; import android.widget.TextView; Hope that should fix it for now :P

Max Eves
PLUS
Max Eves
Courses Plus Student 185 Points

Yeah same for me as well unable to alt-enter. I have put my cursor in every possible location on text view and alt entered nothing happens

Ross Killion
Ross Killion
3,665 Points

I had this problem too but then I realized I had mispelled TextView as Textview with a lowercase 'v' instead of the the uppercase "V". Once I corrected the spelling, the alt+enter worked. Hope that solves your problem.

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

Hey Collin!

Sometimes it can be a bit finicky, but it helps if you have your cursor on the error before hitting ALT+ENTER.

Hope that helps!

Max Eves
Max Eves
Courses Plus Student 185 Points

yeah that's not working been trying for 2 day's now

That's exactly what they said it was not working. Can you provide a different path, please?

Edit: I was misspelling TextView LOL.