You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a brief look at the MediaStore sample. At least here the fix could be as follows.
val deletePermissionLauncher = registerForActivityResult(StartIntentSenderForResult()) {
if (it.resultCode == Activity.RESULT_OK) {
viewModel.deletePendingImage()
}
}
viewModel.permissionNeededForDelete.observe(this, Observer { intentSender ->
intentSender?.let {
// On Android 10+, if the app doesn't have permission to modify
// or delete an item, it returns an `IntentSender` that we can
// use here to prompt the user to grant permission to delete (or modify)
// the image.
deletePermissionLauncher.launch(IntentSenderRequest.Builder(it).build())
}
})
I think then we can remove the override for onActivityResult in MainActivity.
If that approach is accepted, I could have a look at the other samples to see whether similar can be applied.
can the onActivityResult Deprecated be fixed / updated!?
The text was updated successfully, but these errors were encountered: