Android Studio Warning:Not annotated parameter overrides @NonNull parameter
问题:
android studio提示:Not annotated parameter overrides @NonNull parameter
分析:
Warning:The @NonNull annotation can be used to indicate that a given parameter can not be null.
"@NonNull"的含义是注释非空,如果出现以上警告,就表明该参数应该是非空标注。
解决办法:给参数加@NonNull标注。
例如:
public void onReceive(Context context, Intent intent);
修改为:
public void onReceive(@NonNull Context context, @NonNull Intent intent);
这样的话不会有警告了。


