fix crash when sharing file for android 11

This commit is contained in:
Tlaster 2021-03-22 10:54:48 +08:00
parent 4a7d5a99af
commit 205424735b
1 changed files with 6 additions and 2 deletions

View File

@ -624,8 +624,12 @@ class MediaViewerActivity : BaseActivity(), IMediaViewerActivity, MediaSwipeClos
intent.addFlags(Intent.FLAG_GRANT_PREFIX_URI_PERMISSION)
}
activity.processShareIntent(intent)
activity.startActivityForResult(Intent.createChooser(intent, activity.getString(R.string.action_share)),
REQUEST_SHARE_MEDIA)
val shareIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
Intent.createChooser(intent, activity.getString(R.string.action_share))
} else {
Intent.createChooser(intent, activity.getString(R.string.action_share))
}
activity.startActivityForResult(shareIntent, REQUEST_SHARE_MEDIA)
}
override fun onFileSaveFailed() {