gpt4 book ai didi

android - 为@androidx.annotation.Nullable 导入什么?

转载 作者:行者123 更新时间:2023-11-29 23:31:02 32 4
gpt4 key购买 nike

正在执行高级 Android 开发类(class)中的任务。我有扩展 android.view.ViewDialView。构造函数有一个闪烁红色的 @android.annotation.Nullable 参数。导入 android.support.annotation.Nullable 不能解决问题。

minSdkVersion 设置为 15。

错误:找不到符号类 Nullable

public DialView(Context context, @androidx.annotation.Nullable @Nullable AttributeSet attrs) {
super(context, attrs);
}

模块:应用

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

最佳答案

我想它是很久以前发布的,但只是分享我在谷歌搜索中发现的内容。

我尝试迁移到 AndroidX(转到重构菜单并迁移到 AndroidX)并且能够找到该库。在这里可以找到类似的答案和更详细的解释:https://stackoverflow.com/a/53722247/5440297

关于android - 为@androidx.annotation.Nullable 导入什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52659936/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com