Android studio auto fix

前端 未结 2 912
后悔当初
后悔当初 2021-02-12 14:55

I don\'t know what the exact name is for s feature like this, but I will just describe it.

I am using android studio and I added some java classes from a different proje

相关标签:
2条回答
  • 2021-02-12 15:16

    For Windows/Linux, you can go to File -> Settings -> Editor -> General -> Auto Import -> Java and make the following changes:

    change "Insert imports on paste" dropdown value to "All"

    check "Add unambiguous imports on the fly" option

    On a Mac, do the same thing in Android Studio -> Preferences

    0 讨论(0)
  • This is a common frustration. While not a perfect solution, I found https://stackoverflow.com/a/16616085/967131 to work for me.

    For Windows/Linux, you can go to File -> Settings -> Editor -> General -> Auto Import -> Java and make the following changes:

    change "Insert imports on paste" dropdown value to "All"

    check "Add unambiguous imports on the fly" option

    On a Mac, do the same thing in Android Studio -> Preferences

    That way, as you type, or when you copy and paste, many imports will be added automatically. Those that aren't are ambiguous; put the cursor on the class, press alt+enter and select which version of the class you meant.

    0 讨论(0)
提交回复
热议问题