diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java b/owncloudApp/src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java index 4d76925f2a6..a6e353426c2 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java @@ -195,7 +195,13 @@ public void sendDownloadedFile(OCFile file) { String[] packagesToExclude = new String[]{mFileActivity.getPackageName()}; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - mFileActivity.startActivity(Intent.createChooser(sendIntent, "")); + Intent shareSheetIntent = new ShareSheetHelper().getShareSheetIntent( + sendIntent, + mFileActivity.getApplicationContext(), + packagesToExclude + ); + + mFileActivity.startActivity(shareSheetIntent); } else { DialogFragment chooserDialog = ShareLinkToDialog.newInstance(sendIntent, packagesToExclude); chooserDialog.show(mFileActivity.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG); @@ -448,7 +454,13 @@ private void shareLink(String link) { String[] packagesToExclude = new String[]{mFileActivity.getPackageName()}; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - mFileActivity.startActivity(Intent.createChooser(intentToShareLink, "")); + Intent shareSheetIntent = new ShareSheetHelper().getShareSheetIntent( + intentToShareLink, + mFileActivity.getApplicationContext(), + packagesToExclude + ); + + mFileActivity.startActivity(shareSheetIntent); } else { DialogFragment chooserDialog = ShareLinkToDialog.newInstance(intentToShareLink, packagesToExclude); chooserDialog.show(mFileActivity.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG); diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/helpers/ShareSheetHelper.kt b/owncloudApp/src/main/java/com/owncloud/android/ui/helpers/ShareSheetHelper.kt new file mode 100644 index 00000000000..5644fa0e396 --- /dev/null +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/helpers/ShareSheetHelper.kt @@ -0,0 +1,61 @@ +/** + * ownCloud Android client application + * + * @author Abel GarcĂa de Prada + * Copyright (C) 2020 ownCloud GmbH. + *
+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + *
+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see