Call openFile instead of open and avoid unwrapping the Activity context.
This commit is contained in:
committed by
Benoit Marty
parent
9a74948536
commit
7d12425a6f
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user