How to remove unused imports in Intellij IDEA on commit?

前端 未结 9 1624
遥遥无期
遥遥无期 2020-12-23 02:57

Is there a way to remove unused imports in Intellij IDEA on commit?

It is not very optimal to do it manually, CTRL + ALT + O helps b

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-23 03:18

    If you are using IntelliJ IDEA or Android Studio:

    Android optimize imports

    Go to Settings > Editor > General >Auto Import and check the Optimize imports on the fly checkbox.

提交回复
热议问题