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