我试图通过单击按钮(可组合函数)来启动文件选择器。无法使用startActivityForResult()。
@Composable
fun SelectScreen() {
Button(onClick = {
val intent = Intent(Intent.ACTION_GET_CONTENT)
startActivity(intent)
}
) {
Text("BUTTON")
}
}
Run Code Online (Sandbox Code Playgroud) android filechooser filepicker kotlin android-jetpack-compose
我需要观察从 firebase 获取的列表的变化
viewModel.courseList.observe(viewLifeCycleOwner,{
})
Run Code Online (Sandbox Code Playgroud)
但我无法使用viewLifeCycleOwner.