}
}
- // 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) {
ComponentName name=new ComponentName(actInfo.applicationInfo.packageName, actInfo.name);
mIntent.setComponent(name);
+ dialog.dismiss(); // explicitly added for Android 2.x devices
+
// Send the file
((FileActivity)getSherlockActivity()).startActivity(mIntent);
-
+
}
})
.create();
// Create a new share resource
FileOperationsHelper foh = new FileOperationsHelper();
- foh.shareFileWithLinkToApp(mFile, mIntent, (FileActivity)getSherlockActivity());
+ foh.shareFileWithLinkToApp(mFile, mIntent, (FileActivity)getSherlockActivity());
+
}
})
.create();