[英]Hint for @NonNull not working by pressing ALT+ENTER
I am getting problem in shortcut of Auto Insert code: ALT + ENTER 我在自动插入代码的快捷方式中遇到问题: ALT + ENTER
Not annotated parameter overrides @ParametersAreNonnullByDefault
未注释的参数会覆盖@ParametersAreNonnullByDefault
Inspection info: This inspection reports problems related to @Nullable and @NotNull annotations usage configured in Constant conditions & exceptions inspection.
检查信息:此检查报告与在“恒定条件和异常”检查中配置的@Nullable和@NotNull批注使用相关的问题。
I know that by pressing ALT + ENTER we are getting option as below: 我知道通过按ALT + ENTER,我们得到如下选项:
And It will annotate automatically by press ENTER . 然后按ENTER自动注释。
But I am getting following options (There is no option to annotate directly) 但是我得到以下选项(没有选项可以直接注释)
Why the above image not showing option to Annotate
directly. 为什么上面的图片没有显示直接
Annotate
选项。
I am using Android Studio: 我正在使用Android Studio:
Android Studio 3.3.2
Build #AI-182.5107.16.33.5314842, built on February 16, 2019
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.18.0-16-generic
I have one project in PC-1 named "UserApp" created using Android Studio 3.3.1, Another Project "DriverApp" in PC-2 created using same version. 我在PC-1中使用Android Studio 3.3.1创建了一个名为“ UserApp”的项目,在PC-2中使用相同版本创建了一个名为“ DriverApp”的项目。
This annotation problems come up with both project but In "UserApp" its solved by updating Android Studio 3.3.2 这两个项目都出现了注释问题,但是在“ UserApp”中通过更新Android Studio 3.3.2解决了
Now I am coping "DriverApp" in PC-1 but and compiling in Android Studio 3.3.2 but getting same error as previously I got. 现在,我在PC-1中处理“ DriverApp”,但在Android Studio 3.3.2中进行编译,但得到的错误与以前的错误相同。
How can I rebuild "DriverApp" project so I get that annotation working? 如何重建“ DriverApp”项目,以使该注释正常工作?
I have tried: 我努力了:
I found answer as I have implemented following steps: 我已经执行以下步骤,因此找到了答案:
Run inspection on...
Run inspection on...
You will be prompted for Scope of Inspection. 系统将提示您输入检查范围。 That should be
Whole Project
. 那应该是
Whole Project
。
In that you will came to know how many places need to change. 这样一来,您将知道需要更改多少个位置。 By clicking on "AndroidX Annotation", It will use annotation for AndroidX.
通过单击“ AndroidX注释”,它将为AndroidX使用注释。
This problem occurred after Migration of AndroidX. 迁移AndroidX后发生此问题。
Hope it will helps you. 希望对您有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.