简体   繁体   中英

How to Optimize Imports on All Files in Android Studio

如何Optimize Imports整个文件夹或项目的Optimize Imports

try the Optimize imports (Option + Ctr + O) option in android studio

go to Preferences --> Keymap -- > and look for "Optimize imports" to find the right shortcut

If Android Studio is still based off of Eclipse, try

Ctrl + Alt + O

Which should be organize / optimize imports.

Ctrl + Alt + F

Runs the auto code formatter.

To optimize imports on the whole project, choose the folder/project you want from the project pane, then press:

  • Ctrl Alt O on Windows
  • Ctrl Option O on Mac

Optimize Imports is also available from the right-click menu on projects, folders, files, etc in the project pane.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM