mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Call openFile instead of open and avoid unwrapping the Activity context.
This commit is contained in:
committed by
Benoit Marty
parent
bf49078e40
commit
3eb112381d
+2
-2
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user