0

In IntelliJ you can press Ctrl-Alt-O to import namespaces for classes that are being referenced. I did this and it did import some classes but not others. I'm actually using Android Studio which is based on IntelliJ. The class I'm trying to import is IBinder but when I hover over the class name it indicates:

Cannot resolve symbol 'IBinder'

Since this is based on Gradle, am I suppose to manually include something in the build.gradle? Or does Android Studio automatically add the dependency for the classes I want to use? IBinder is a rather standard interface, so I can hardly believe I need to add something special.

Johann
  • 27,536
  • 39
  • 165
  • 279
  • When importing it manually does it work though? I know the answer below doesn't really answer your question, but its good to know whether its an IDE thing or maybe something isn't mapping correctly – Andy Jan 20 '15 at 14:37

1 Answers1

1

You mean android.os.IBinder?

A simple import android.os.IBinder should work, shouldn't it?

BTW, on my Android Studio (default) installation, Ctrl-Alt-O organizes imports, but does not import them.

shkschneider
  • 17,833
  • 13
  • 59
  • 112
  • The point is that I shouldn't have to type that in. Ctrl-Alt-O should import that automatically. – Johann Jan 20 '15 at 14:35
  • Doesn't Ctrl-Alt-O just organizes imports? My Android Studio only does that, but does not import them. – shkschneider Jan 20 '15 at 14:37
  • Maybe try `alt-enter`? Or `alt-space`, I usually forget which one. – Andy Jan 20 '15 at 14:39
  • Actually, you have to modify the settings for importing. I found this post that answers my question but it doesn't appear to be "auto import". You are still required to hit Alt-Enter on every class that needs to be imported: http://stackoverflow.com/a/16616085/753632 – Johann Jan 20 '15 at 14:40
  • Yea, I guess thats one thing people miss about eclipse. Just that ONE thing :) – Andy Jan 20 '15 at 14:41
  • 1
    Mine does auto-import (via popup) when I paste some code (and I did not change any settings). Alt-Enter to manually import them (one by one I know...) – shkschneider Jan 20 '15 at 14:42