Browse Source

OC-3078: (Fix bug) Appear 'Copy link' option on the send menu

masensio 11 years ago
parent
commit
7c0865ae0f
1 changed files with 10 additions and 6 deletions
  1. 10 6
      src/com/owncloud/android/ui/dialog/ShareLinkToDialog.java

+ 10 - 6
src/com/owncloud/android/ui/dialog/ShareLinkToDialog.java

@@ -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)); 
         Collections.sort(activities, new ResolveInfo.DisplayNameComparator(pm)); 
         mAdapter = new ActivityAdapter(getSherlockActivity(), pm, activities);
         mAdapter = new ActivityAdapter(getSherlockActivity(), pm, activities);
         
         
-        boolean sendAction = mIntent.getBooleanExtra(Intent.ACTION_SEND, false);
+       
         
         
         if (sendAction) {
         if (sendAction) {