0

I have an app that shares audio files by WhatsApp, email, etc. My code works for one single file, but it does not work for two or more files at the same time. This is my code:

Intent intent = new Intent(Intent.ACTION_SEND).setType("audio/*");

for (i=0;i<completepath.size();i++)
{
    File send=new File(completepath.get(i));
    intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(send));
}

startActivity(Intent.createChooser(intent, "Send audio "));
TylerH
  • 20,799
  • 66
  • 75
  • 101
tatyana
  • 55
  • 7

1 Answers1

0

There is the additional send command for Intent.ACTION_SEND_MULTIPLE that you can take advantage of within the documentation.

This here gives an idea of the process behind the use of the intent from another relevant post.

Community
  • 1
  • 1
Jay Snayder
  • 4,298
  • 4
  • 27
  • 53