ST
Size: a a a
ST
V
ST
ST
val getContent = registerForActivityResult(GetContent()) { uri: Uri? ->
// Handle the returned Uri
}
override fun onCreate(savedInstanceState: Bundle?) {
// ...
val selectButton = findViewById<Button>(R.id.select_button)
selectButton.setOnClickListener {
// Use the Kotlin extension in activity-ktx
// passing it the mime type you'd like to allow the user to select
getContent("image/*")
}
}V
ST
setFragmentResultListener("test_data") { key, bandle ->
val data = bandle.getString("data_test")
debugLog { "Data $data" }
}ST
setFragmentResult("test_data", bundleOf("data_test" to "Hello World"))V
ST
ST
ST
ST
YW
AP
КР
AY