Where to find `android.annotation.Nullable`

问题: If I open android.content.SharedPreferences class from SDK, I can see that it imports android.annotation.Nullable class, but I can't open that class, it's not on my classpa...

问题:

If I open android.content.SharedPreferences class from SDK, I can see that it imports android.annotation.Nullable class, but I can't open that class, it's not on my classpath. And Android Studio does not recognize this annotation (so on my Kotlin code I'm not getting proper nullable types when using methods from SharedPreferences class). I have android.support.annotation.Nullable, org.jetbrains.annotations.Nullable, javax.annotation.Nullable, but not android.annotation.Nullable.

I have android.jar from my SDK on classpath and there are two classes in android.annotation package: SuppressLint and TargetApi, but not Nullable.

I'm using Android Studio 3.3.1 and just created default project with Kotlin and 5.0 minimum target.


回答1:

This blog says: "android.annotation.Nullable is for internal usage only. ... Use android.support.annotation.Nullable."

  • 发表于 2019-03-04 14:25
  • 阅读 ( 780 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除