如果有时候引入不用的包,但是不需要手动去除,只需要自动去除。 首先File – setting Editor – General – Auto Import, 然后勾选 Optimize import on the fly 即可,保存就会自动去掉不需要的包。