kotlin - 找不到 Android registerForActivityResult

标签 kotlin android-activity android-jetpack

最近我根据这个更新了我对activity-ktx的依赖 https://developer.android.com/jetpack/androidx/releases/activity#1.2.0

但是,未找到 registerForActivityResult()。在此更新之前它正在运行。 androidx.activity:activity-ktx:1.2.0有什么变化吗?

enter image description here

最佳答案

我设法解决了我的问题。我想我会在这里发布我的答案,以防对其他人有帮助。

我的解决方案是更新此依赖项。

implementation 'androidx.appcompat:appcompat:1.3.0-beta01'

只有当我将版本更改为 1.3.0 时,我的 AS 才没有警告我更新。

PS:我指的是这个Cannot access 'androidx.activity.result.ActivityResultCaller'

关于kotlin - 找不到 Android registerForActivityResult,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66209464/

相关文章:

android - 在 JetPack Composable 中观察 LiveData

Android 启动/停止服务

Android - 如何检测堆栈中的最终 Activity

Android NestedScrollView.smoothScrollBy() 滚动太远

MySQL 使用 Kotlin 连接表暴露错误 : "no matching primary/foreign key pair"

android - 我可以在伴生对象中共享 ViewModel 吗?

java - 监控以 startActivity() 启动的 Activity

android - 在模块中找到重复的类 com.google.android.a.a?

android - 有没有办法设置自动刷新jetpack compose预览?

android - 来自位图源的图像的 LazyColumn 闪烁/闪烁