Revert "fix crash when sharing file for android 11"

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

View File

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