1

Learning Android development now to port my iOS game. Wow it's much different than what I'm used to.

I'm following the tutorial on developer.android.com and it says that option + return (I'm on a Mac) will import the missing classes. Well it doesn't do that. Instead it does different actions depending on where I press it. If it's after the imports a "Create Test >" prompt comes up. If it's in the middle of the method a "Split into declaration and assignment>" prompt comes up.

On the developer.android.com website it says option + return will import the missing classes... and for a few times it did but now this is what happens to me. I am using Android Studio on a Mac. What am I overlooking?

Scott
  • 1,154
  • 1
  • 12
  • 25

2 Answers2

1

It looks like this shortcut is not available in Android Studio. I tried Option + Return in Mac, Cntrl+Option+O (suggested for Eclipse), but they did not work.

I finally used the answer given by ethemsulan at What is the shortcut to Auto import all in Android Studio?

I am copying the answer from the link here for ease of reference.

Open Android Studio and go to Android Studio --> Preferences --> Editors --> Auto Import

  • Checked Optimize imports on the fly option
  • Checked Add unambiguous imports on the fly option
  • Click Apply and OK button.

and updated the Editor preferences of Android Studio. This did the trick for me and the import statements necessary were added by Android Studio automatically.

Community
  • 1
  • 1
ryadavalli
  • 101
  • 5
0

On a Mac running Eclipse, you want to use Cmd+Shift+O.

JASON G PETERSON
  • 2,193
  • 1
  • 18
  • 19
  • Sorry, I included the android-studio tag but I also edited the question to include that I am running Android Studio. – Scott Dec 11 '14 at 06:36
  • For AS, check out this answer: http://stackoverflow.com/questions/16615038/what-is-the-shortcut-to-auto-import-all-in-android-studio. Good luck! – JASON G PETERSON Dec 11 '14 at 06:37
  • Thanks, I did notice that answer while I was searching. Tried the suggestions and they didn't help. The issue isn't me trying to be faster than pressing alt+enter it's alt+enter not doing what it's supposed to do. – Scott Dec 11 '14 at 06:41