Merge branch 'develop' into send_file_pr311_with_develop
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / preview / PreviewImageFragment.java
index 5a34686..5560c27 100644 (file)
@@ -311,7 +311,8 @@ public class PreviewImageFragment extends FileFragment implements   OnRemoteOper
                 return true;
             }
             case R.id.action_send_file: {
-                shareFile();
+                FileActivity act = (FileActivity)getSherlockActivity();
+                act.getFileOperationsHelper().sendDownloadedFile(getFile(), act);
                 return true;
             }
             
@@ -320,15 +321,6 @@ public class PreviewImageFragment extends FileFragment implements   OnRemoteOper
         }
     }
     
-    private void shareFile(){
-        Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
-        // set MimeType
-        sharingIntent.setType(getFile().getMimetype());
-        sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+getFile().getStoragePath()));
-        startActivity(Intent.createChooser(sharingIntent, "Share via"));
-    }
-
-    
 
     private void seeDetails() {
         ((FileFragment.ContainerActivity)getActivity()).showDetails(getFile());