Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio import class shortcut

I've looked at How to auto import the necessary classes in Android Studio with shortcut? but it doesn't help.

Ctrl+Alt+O does nothing.

enter image description here

When I press alt+enter I get the following:

enter image description here

I do not want this, I wish for it to appear as a normal import at the top of the file.

What are these shortcuts called in Android Studio? This program makes it complicated to edit such simple shortcuts.

I also have auto-imports, but it isn't working:

enter image description here

like image 606
basickarl Avatar asked May 10 '15 14:05

basickarl


People also ask

What is the shortcut key of import?

Cmd+I is the shortcut for Import, but just remember, that brings up this traditional import dialog, where you search for what you want and bring it into the project.

What is the shortcut to auto import all in Android Studio?

You can simply import all of them by pressing the ALT + ENTER key.

What is the shortcut for importing the methods in Java?

From the main menu, select Code | Optimize Imports (or press Ctrl+Alt+O ).


3 Answers

Finally after hours of trail and error the following settings is what fixed it:

enter image description here

enter image description here

like image 113
basickarl Avatar answered Oct 22 '22 13:10

basickarl


Pressing Ctrl + Space on Mac will open a dialog to choose which library to import.

like image 20
Hamed MP Avatar answered Oct 22 '22 15:10

Hamed MP


check this link for detail ans https://stackoverflow.com/a/37362700/3288890

or

goto file -> setting select keymap and search for auto import and add keyboard short cut

enter image description here

like image 1
Adiii Avatar answered Oct 22 '22 15:10

Adiii