Reputation: 7520
I am following the basic tutorials in the Android Developer official site. And there's a part that I cant get to work.
The instruction said if you want to import the missing class just use ALT + ENTER
on the top part of the class.
When I do that it wont import the missing classes. Instead its just viewing the Create Test
option only.
I'm new in Android development I hope you can help me.
Upvotes: 2
Views: 11096
Reputation: 1501
Auto import will only work if the missing class in question is underlined. So if you see a class in red, click on the screen somewhere close to the class to adjust the cursor position and then try ALT + ENTER once the class name is underlined.
Another option is to auto complete when typing the class name (which can be accomplished via ENTER or TAB, sorry muscle memory makes me forget which...) This will automatically import the appropriate class.
If you are using a third party library and this isn't appearing properly, make sure you add a compile statement for that library in your gradle build file.
Upvotes: 6