Skip to content

Commit

Permalink
Call openFile instead of open and avoid unwrapping the Activity c…
Browse files Browse the repository at this point in the history
…ontext.
  • Loading branch information
bmarty committed Sep 26, 2023
1 parent bf49078 commit 3eb1123
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AndroidLocalMediaActions @Inject constructor(
if (activityResult.resultCode == Activity.RESULT_OK) {
pendingMedia?.let {
coroutineScope.launch {
open(it)
openFile(it)
}
}
} else {
Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 3eb1123

Please sign in to comment.