Android Studio “Import class” action adds fully qualified name

前端 未结 1 1282
自闭症患者
自闭症患者 2020-12-31 05:43

Using Android Studio, when I type the name of a class which I have no import for and use the \"Import class\" action (using either ALT-ENTER or choosing the \"Import class\"

相关标签:
1条回答
  • 2020-12-31 06:07

    So I did the same thing. It took me a while to realize, but I had checked the (menu) File --> Settings (in dialog) Code Style --> Java --> Imports (tab) --> "Use fully qualified class names" checkbox.

    As soon as I un-checked that, Android studio stopped fully qualifying the class names that did not (yet) have import statements for. An example was when I was trying to cast to TextView in my code and it auto fully qualified it. Now it just adds it as an import at the top!

    Note I am using Android Studio 0.5.9 in case my path to the checkbox is different than yours. Good Luck! Paul

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