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

Android Studio Warning:Not annotated parameter overrides @NonNull parameter

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

问题:

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://xjtudll.cn/Exp/386/

分享给朋友:

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

检测NSWindow关闭

You can declare your custom class to conform to NSWindowDelegate protocol. Set an instance of your custom class to be the delegate of your wind...

C#将图片白色背景设置为透明

红色部分是关键 Image image = System.Drawing.Image.FromFile(@"C:\A.JPG"); Bitmap pbitmap = new Bitmap(image); pbitmap.MakeTransparent(Color.White);...

Qt打包发布程序

Qt打包发布程序

Qt发布程序有两种方式,静态编译和动态编译。静态编译操作繁琐,东拉西扯要N长时间,所以我选择的是动态发布,动态发布有个缺点,就是要附加多个dll文件,传输极为不便,如果能搞成单文件就比较爽了。 本文就是讲述如何将多个文件打包成一个exe文件。 当然,你首先要将Qt编译设置成Release模式,将Re...

RDLC报表:不同的页眉

RDLC报表:不同的页眉

问题描述: RDLC报表,需要首页页眉和后面的页面页眉不同 解决办法: 利用Hidden属性和内置字段PageNumber。适当隐藏某些元素。 则可实现不同的页眉。 例如:某个元素仅第一页显示 参考资料: https://forums.asp.net/t/2031340.aspx?having+...

CrystalDecisions.Windows.Forms.CrystalReportViewer.DisplayGroupTree”已过时

问题:早期工程升级到VS2010 提示: CrystalDecisions.Windows.Forms.CrystalReportViewer.DisplayGroupTree”已过时 解决办法: this.crystalReportViewer1.DisplayGroupTree =...

XCode 模拟器完整分辨率截屏

XCode 模拟器完整分辨率截屏

选中模拟器 window-->去掉Show Device Bezels的勾选 -->Zoom 然后cmd + s 保存...

发表评论

访客

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