- Shortcuts For Mac Computer
- Android Studio For Mac Simple App
- Android Studio Keyboard Shortcuts
- Android Studio Comment Shortcut
Is there any way of auto importing (like in Eclipse Shift+Ctrl+O) in Android Studio?
I have found only Ctrl+Alt+O which ask for each thing, and I have to press Alt+Enter to accept it.
Here you will get android studio keyboard shortcuts for windows, linux and mac os that I have taken from official android developers website. Knowing keyboard shortcuts makes our work little bit faster while using an application, specially when you are an android developer. 🙂 Below is the android. (PS: 以上快捷键没有在win平台尝试确认,欢迎反馈错误与补充) 自动导包.
No way to do it faster?
Zoe11 Answers
For Windows/Linux, you can go to File
->Settings
->Editor
->General
->Auto Import
->Java
and make the following changes:
change
Insert imports on paste
value toAll
mark
Add unambigious imports on the fly
option as checked
On a Mac, do the same thing in Android Studio
->Preferences
After this, all unambiguous imports will be added automatically.
Vladimir MironovVladimir MironovBy changing the keymaps settings you can use the same keyboard short cuts as in Eclipse (Or your favourite IDE)
File -> Settings -> KeyMap
Android Studio -> Preferences -> KeyMap (Mac)
Change keymaps settings to eclipse so that you can use the short cut keys like in eclipse. For those who just want to change this one setting, it is
Main Menu -> Code -> Optimize Imports...
QEDThese are the shortcuts used in Android studio
Go to class CTRL + N
Go to file CTRL + Shift + N
Navigate open tabs ALT + Left-Arrow; ALT + Right-Arrow
Look up recent files CTRL + E
Go to line CTRL + G
Navigate to last edit location CTRL + SHIFT + BACKSPACE
Go to declaration CTRL + B
Go to implementation CTRL + ALT + B
Go to source F4
Go to super Class CTRL + U
Show Call hierarchy CTRL + ALT + H
Search in path/project CTRL + SHIFT + F
Programming Shortcuts:-
Reformat code CTRL + ALT + L
Optimize imports CTRL + ALT + O
Code Completion CTRL + SPACE
Issue quick fix ALT + ENTER
Surround code block CTRL + ALT + T
Rename and Refractor Shift + F6
Line Comment or Uncomment CTRL + /
Block Comment or Uncomment CTRL + SHIFT + /
Go to previous/next method ALT + UP/DOWN
Show parameters for method CTRL + P
Quick documentation lookup CTRL + Q
Delete a line CTRL + Y
View declaration in layout CTRL + B
For more info visit Things worked in Android
K.DᴀᴠɪsAndroid 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.
Note that in my Android Studio 1.4, Auto Import now under General
(Android Studio --> Preferences --> Editors --> General --> Auto Import)
Ajay2707You can make short cut key for missing import in android studio which you like
- Click on file Menu
- Click on Settting
- click on key map
- Search for 'auto-import'
- double click on auto import and select add keyboard short cut key
- that's all
Note: You can import single missing import using alt+enter which shown in pop up
AdiiiAdiiiOn Windows, highlight the code that has classes which need to be resolved and hit Alt+Enter
Go to File -> Settings -> Editor -> Auto Import -> Java and make the below things:
Select Insert imports on paste value to All
Do tick mark on Add unambigious imports on the fly option and 'Optimize imports on the fly*
Ajay2707For Linux (Ubuntu 14.04), you can go to
File -> Settings -> Editor -> Auto Import
check all the boxes and insert all imports on paste.
In the Latest Version of Android Studio, the options for Auto-Import is enabled by default, so kudos no need to worry about that.
On Windows:If for some reasons auto-import is not enable you can go to settings by typing shortcut: Ctrl+Alt+S.
In the Search term just type 'Auto-Import' and then select 'Add unambiguous Imports on the fly' and click Ok.
That's it. You are Done.SnapShot of Auto_import
Shortcuts For Mac Computer
File > Settings > Editor > General >Auto Import (Mac: Android Studio > Preferences > Editor > General >Auto Import).
Android Studio For Mac Simple App
Select all check boxes and set Insert imports on paste to All. Unambiguous imports are now added automatically to your files.
MRXAndroid Studio Keyboard Shortcuts
MRXprotected by Community♦May 21 '16 at 9:43
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?