2

I have no idea what is going on. I'm using Android Studio and i've created a new Blank Project.

I type import an and the only thing that shows up in Annotation if i try to edit the existing 4 imports, it turns red and then switches everything back to those 4.

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;

I have no clue whats going on.

enter image description here

3 Answers3

6

Sorry for late answer.

I solved this problem using Invalidate Caches/Restart.

Go to File > Invalidate Caches/Restart.

The dialog will display and again select Invalidate Caches/Restart.

Chirag Savsani
  • 6,020
  • 4
  • 38
  • 74
0

You've provided very little information, but my guess is that your IDE is not locating your Android SDK.

Please make sure that everything is configured correctly. If it is, I suggest either providing more information (did your environment ever work properly? What are the changes?), or reinstall the IDE.

Community
  • 1
  • 1
Vaiden
  • 15,728
  • 7
  • 61
  • 91
  • Vaiden - yes everything worked correctly up till this morning. I havent changed any configuration –  Apr 25 '15 at 13:31
  • Vaiden - I also followed your link everything is configured correctly. Again, I havent changed any configuration –  Apr 25 '15 at 13:33
  • Then I suggest trying to create a new project, and if that doesn't help - reinstalling the environment. – Vaiden Apr 25 '15 at 13:44
0

Looks like this is the normal behavior.

For me, I tried to use Handler which strangely isn't automatically imported. So I typed an which returns only:

enter image description here

In fact typing android will not show any suggestion:

enter image description here

Only after I typed android. (with dot) then I begin to see android related packages.

enter image description here

But this is pointless because I don't know which package Handler is in. So in the end I have to look it up on internet and paste the whole thing manually.

inmyth
  • 8,880
  • 4
  • 47
  • 52
  • Can't you just write `Handler` somewhere, and wait for AS to ask you `Import class...`? On OSX, you just put the cursor over the unimported class and go option-enter. – natario Apr 25 '15 at 14:18
  • That's what I do to any other import but for Handler it just stayed there in red without any light bulb icon. Or maybe I didn't wait long enough. – inmyth Apr 25 '15 at 14:31
  • @inmyth actually this is normal behavior when automatic import is checked, i figured it out. –  Apr 25 '15 at 14:45