Skip to content

Commit

Permalink
fix: share action not working
Browse files Browse the repository at this point in the history
  • Loading branch information
JunkFood02 committed Sep 2, 2023
1 parent f153b76 commit 7d48d61
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/com/junkfood/seal/util/FileUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ object FileUtil {

fun createIntentForSharingFile(path: String?): Intent? = createIntentForFile(path)?.apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_STREAM, this.data)
type = "*/*"
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
putExtra(Intent.EXTRA_STREAM, data)
val mimeType = data?.let { context.contentResolver.getType(it) } ?: "media/*"
setDataAndType(this.data, mimeType)
clipData = ClipData(
null,
arrayOf("*/*"),
arrayOf(mimeType),
ClipData.Item(data)
)
}
Expand Down

0 comments on commit 7d48d61

Please sign in to comment.