Call openFile instead of open and avoid unwrapping the Activity context.
This commit is contained in:
parent
bf49078e40
commit
3eb112381d
1 changed files with 2 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ class AndroidLocalMediaActions @Inject constructor(
|
|||
if (activityResult.resultCode == Activity.RESULT_OK) {
|
||||
pendingMedia?.let {
|
||||
coroutineScope.launch {
|
||||
open(it)
|
||||
openFile(it)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -152,7 +152,7 @@ class AndroidLocalMediaActions @Inject constructor(
|
|||
.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
.setDataAndType(localMedia.toShareableUri(), localMedia.info.mimeType)
|
||||
withContext(coroutineDispatchers.main) {
|
||||
activityContext!!.startActivity(openMediaIntent)
|
||||
activityContext?.startActivity(openMediaIntent)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue