当前位置:首页 > 技术心得 > 正文内容

Android Studio Warning:Not annotated parameter overrides @NonNull parameter

xjtudll11年前 (2016-02-06)技术心得29360

问题:

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);

这样的话不会有警告了。

扫描二维码推送至手机访问。

版权声明:本文由鸟的天空发布,如需转载请注明出处。

本文链接:http://www.xjtudll.cn/Exp/386/

分享给朋友:

“Android Studio Warning:Not annotated parameter overrides @NonNull parameter” 的相关文章

Multisim示波器设置

Multisim示波器设置

在使用Multisim的时候,经常要用到示波器,但是在用到双通道的时候,两通道波形显示的颜色经常是一样的,无法直观的分辨到底是哪个通道。 其实Multisim里面有设置: 选中与示波器相连的那根线,右键,选择图块颜色,操作后会出现颜色选择的窗口,如下图。 选择一个颜色即可。 以一个电路图为例,下图...

OKI单片机——ML610Q4XX PWM

OKI单片机——ML610Q4XX PWM

  /***********************************************/ * @brief 初始PWM 引脚 * @details /***********************************************/ void P43_Init...

Xcode Warning:No rule to process file xxx 解决

Xcode Warning:No rule to process file xxx 解决

在编译程序的时候,Xcode给出了警告:warning: no rule to process file '$(PROJECT_DIR)/xxx.h' of type sourcecode.c.h for architecture armv7。如图所示: 从warning中我们可以看出是某个.h...

OSX:如何移动NSWindow而同时不移动其子Window

参考资料: http://stackoverflow.com/questions/7657132/how-to-move-an-nswindow-without-moving-child-nswindows 问题: 应用程序有个主window,在主window里,新建了一个子window。 每当移动...

获取NSImage图片的准确大小

问题: NSImage加载图片的时候无法准确获得图片的大小 测试代码: NSImage *image = [NSImage imageNamed:@"image"]; NSLog(@"%f, %f", image.size.width, image.size....

Quartus II 中管脚上拉电阻(弱上拉)的设置方法

Quartus II 中管脚上拉电阻(弱上拉)的设置方法

参考资料: http://blog.sina.com.cn/s/blog_706f04d20100oelx.html 由于系统需求,需要在管脚的内部加上上拉电阻,目的是为了有个固定的初始状态。 以Quartus II 11.0为例,具体过程如下: 1、在菜单Assignments 中选择Assig...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。