android - 为什么 android studio 在导入时会显示以下警告?

标签 android android-studio

以下导入是黄色的,但没有抛出错误,单击它们也会将我带到相应的支持注释 jar 类:

import android.support.annotation.NonNull; 
import android.support.annotation.Nullable;

enter image description here

悬停消息:

enter image description here

我如何将 android.support.annotation 中的代码标记为 depricated,它不是我的代码。

最佳答案

enter image description here这些导入类的黄线表示注释类,默认情况下为黄色,因此您的编码没有问题。

导入android.support.annotation.NonNull;

导入android.support.annotation.Nullable;

关于android - 为什么 android studio 在导入时会显示以下警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46147782/

相关文章:

java - Webview 为空白或为不同的 url 加载同一页面

java - Android Studio 编译时无法删除文件

android-studio - 安卓工作室 : How to wrap code in parenthesis

android - 为什么我不能使用 AndroidX 库导入 PreferenceFragmentCompat?

java - 尝试在Android Studio上实现RapidApi

android - 如何通过resValue添加文本翻译

java - 当关闭并重​​新打开应用程序时,共享首选项中保存的数据未显示?

android - 错误 "can' t 使用颠覆命令行客户端 : svn"when opening android project checked out from svn

android - 带有 JSON 数组的 ExpandableListView

android - 启动时自动更新旁加载 Android 应用程序