Fix multiple share intent issue

This commit is contained in:
Benoit Marty 2020-02-17 17:26:19 +01:00
parent 51bbee297c
commit 002e881704
1 changed files with 12 additions and 10 deletions

View File

@ -76,17 +76,19 @@ class IncomingShareFragment @Inject constructor(
attachmentsHelper = AttachmentsHelper.create(this, this).register() attachmentsHelper = AttachmentsHelper.create(this, this).register()
val intent = vectorBaseActivity.intent val intent = vectorBaseActivity.intent
if (intent?.action == Intent.ACTION_SEND || intent?.action == Intent.ACTION_SEND_MULTIPLE) { val isShareManaged = when (intent?.action) {
var isShareManaged = attachmentsHelper.handleShareIntent( Intent.ACTION_SEND -> {
IntentUtils.getPickerIntentForSharing(intent) var isShareManaged = attachmentsHelper.handleShareIntent(IntentUtils.getPickerIntentForSharing(intent))
)
if (!isShareManaged) { if (!isShareManaged) {
isShareManaged = handleTextShare(intent) isShareManaged = handleTextShare(intent)
} }
if (!isShareManaged) { isShareManaged
cannotManageShare(R.string.error_handling_incoming_share)
} }
} else { Intent.ACTION_SEND_MULTIPLE -> attachmentsHelper.handleShareIntent(intent)
else -> false
}
if (!isShareManaged) {
cannotManageShare(R.string.error_handling_incoming_share) cannotManageShare(R.string.error_handling_incoming_share)
} }