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

Categories

0 votes
683 views
in Technique[技术] by (71.8m points)

android-studio - 在Android Studio中自动导入所有内容的快捷方式是什么?(What is the shortcut to Auto import all in Android Studio?)

Is there any way of auto importing (like in Eclipse Shift + Ctrl + O ) in Android Studio?

(Android Studio中是否有任何自动导入方式(如Eclipse Shift + Ctrl + O )?)

I have found only Ctrl + Alt + O which ask for each thing, and I have to press Alt + Enter to accept it.

(我发现只有Ctrl + Alt + O要求每个东西,我必须按Alt + Enter接受它。)

No way to do it faster?

(没办法做得更快?)

  ask by Micha? Tajchert translate from so

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

1 Answer

0 votes
by (71.8m points)

For Windows/Linux, you can go to File -> Settings -> Editor -> General -> Auto Import -> Java and make the following changes:

(对于Windows / Linux,您可以转到File - > Settings - > Editor - > General - > Auto Import - > Java并进行以下更改:)

  • change Insert imports on paste value to All

    (更改将Insert imports on paste值上的Insert imports on pasteAll)

  • mark Add unambigious imports on the fly option as checked

    (mark选中“ Add unambigious imports on the fly选项”作为选中状态)

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

(在Mac上,在Android Studio执行相同操作 - > Preferences)

在此输入图像描述

After this, all unambiguous imports will be added automatically.

(在此之后,将自动添加所有明确的导入。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...