X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/b599f945e691230a280c26c109483c3cc03c60cf..6cf78042b08666fc50666fc973b2e157742dd90c:/src/com/owncloud/android/files/FileOperationsHelper.java?ds=sidebyside diff --git a/src/com/owncloud/android/files/FileOperationsHelper.java b/src/com/owncloud/android/files/FileOperationsHelper.java index 4b37a3ba..a0927b2f 100644 --- a/src/com/owncloud/android/files/FileOperationsHelper.java +++ b/src/com/owncloud/android/files/FileOperationsHelper.java @@ -139,7 +139,7 @@ public class FileOperationsHelper { } return false; } - + public void unshareFileWithLink(OCFile file, FileActivity callerActivity) { @@ -160,4 +160,23 @@ public class FileOperationsHelper { } } + + public void sendDownloadedFile(OCFile file, FileActivity callerActivity) { + if (file != null) { + Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND); + // set MimeType + sendIntent.setType(file.getMimetype()); + sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + file.getStoragePath())); + sendIntent.putExtra(Intent.ACTION_SEND, true); // Send Action + + // Show dialog, without the own app + String[] packagesToExclude = new String[] { callerActivity.getPackageName() }; + DialogFragment chooserDialog = ActivityChooserDialog.newInstance(sendIntent, packagesToExclude, file); + chooserDialog.show(callerActivity.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG); + + } else { + Log_OC.wtf(TAG, "Trying to send a NULL OCFile"); + } + } + }