1.快捷鍵
Ctrl+Alt+O
2.點擊項目右鍵,點擊Optimize Imports

Optimize Imports
3.通過設(shè)置,可以在編碼過程中自行刪除多余的import,無需手動(Do it on the fly)
在下面的位置打?qū)?br> File->Settings->Editor->Auto Import->Optimize Imports on the fly

Do optimize imports on the fly
Ctrl+Alt+O
在下面的位置打?qū)?br> File->Settings->Editor->Auto Import->Optimize Imports on the fly