Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

No way to do it faster?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
828 views
Welcome To Ask or Share your Answers For Others

1 Answer

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 to All

  • markAdd unambigious imports on the fly option as checked

On a Mac, do the same thing in Android Studio -> Preferences

enter image description here

After this, all unambiguous imports will be added automatically.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...