且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android Studio“导入类"操作添加完全限定名称

更新时间:2023-02-08 22:05:08

所以我做了同样的事情.我花了一段时间才意识到,但我已经检查了(菜单)文件 --> 设置(在对话框中)代码样式 --> Java --> 导入(选项卡)-->使用完全限定的类名"复选框.

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.

一旦我取消选中,Android studio 就停止完全限定那些(还)没有导入语句的类名.一个例子是当我试图在我的代码中转换为 TextView 并且它自动完全限定它时.现在它只是将其添加为顶部的导入!

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!

注意我使用的是 Android Studio 0.5.9,以防我的复选框路径与您的不同.祝你好运!保罗

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