安卓@Nullable注解 [英] android @Nullable annotation

查看:896
本文介绍了安卓@Nullable注解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建

安卓@Nullable注释

android @Nullable annotation

我检查例如这两个链接

http://findbugs.sourceforge.net/ API / EDU / UMD / CS / FindBugs的/注解/ Nullable.html
HTTP://$c$c.google.com/p/google -guice /维基/ UseNullable

但没有在android的工作,因为的RetentionPolicy,的ElementType是无效的。

but none works in android because RetentionPolicy, ElementType is not valid

如何创建在android系统@Nullable注释?

How can i create @Nullable annotation in android?

推荐答案

包含 JSR-305 JAR 在项目库文件。使用 @nullable 与字段和RoboGuice将停止抱怨空的对象。

Include jsr-305 jar file in project libraries. Use @nullable with fields and RoboGuice will stop complaining about null objects.

这篇关于安卓@Nullable注解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆