I have a list of files in my android app and I want to be able to get the selected items and send them via email or any other sharing app. Here is my code.
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_EMAIL, getListView().getCheckedItemIds());
sendIntent.setType("text/plain");
startActivity(sendIntent);
Use ACTION_SEND_MULTIPLE for delivering multiple data to someone
The
arrayUri
is the Array List of Uri of files to Send.Here is an example to share or save a text file: