OC-3078: (Fix bug) Appear 'Copy link' option on the send menu
authormasensio <masensio@solidgear.es>
Tue, 25 Feb 2014 10:18:43 +0000 (11:18 +0100)
committermasensio <masensio@solidgear.es>
Tue, 25 Feb 2014 10:18:43 +0000 (11:18 +0100)
src/com/owncloud/android/ui/dialog/ShareLinkToDialog.java

index 68e1485..f4af7e1 100644 (file)
@@ -97,17 +97,21 @@ public class ShareLinkToDialog  extends SherlockDialogFragment {
             }
         }
         
-        // add activity for copy to clipboard
-        Intent copyToClipboardIntent = new Intent(getSherlockActivity(), CopyToClipboardActivity.class);
-        List<ResolveInfo> copyToClipboard = pm.queryIntentActivities(copyToClipboardIntent, 0);
-        if (!copyToClipboard.isEmpty()) {
-            activities.add(copyToClipboard.get(0));
+        boolean sendAction = mIntent.getBooleanExtra(Intent.ACTION_SEND, false);
+        
+        if (!sendAction) {
+            // add activity for copy to clipboard
+            Intent copyToClipboardIntent = new Intent(getSherlockActivity(), CopyToClipboardActivity.class);
+            List<ResolveInfo> copyToClipboard = pm.queryIntentActivities(copyToClipboardIntent, 0);
+            if (!copyToClipboard.isEmpty()) {
+                activities.add(copyToClipboard.get(0));
+            }
         }
         
         Collections.sort(activities, new ResolveInfo.DisplayNameComparator(pm)); 
         mAdapter = new ActivityAdapter(getSherlockActivity(), pm, activities);
         
-        boolean sendAction = mIntent.getBooleanExtra(Intent.ACTION_SEND, false);
+       
         
         if (sendAction) {