点击 File--》settings--》Editor-->General-->Auto Import 选择 optimize imports on the fly 和 Add unambiguous imports on the fly,在这两个选项打对勾