Sending multiple files via Bluetooth

I am using below code to send a file using blue tooth from one device to another. I want to send multiple files at the same time. Can anyone explain to me how to parse multiple URIs for a file. I've tried doing this with a string tokenizer and a while, but in this case, the default blue tooth request goes twice by default. if there are two parsing files).

StringTokenizer tokens = new StringTokenizer(music, ",");

    String stored = "";
    while (tokens.hasMoreTokens()) {

        stored = tokens.nextToken();


        File file = new File(stored);
        Log.d("file===", stored);

        intentfile = new Intent();
        intentfile.setAction(android.content.Intent.ACTION_SEND);

        intentfile.setType("video/*");

        intentfile.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
        startActivityForResult(intentfile, SEND_REQUEST);


    }

      

+3


source to share


1 answer


I use setAction(Intent.ACTION_SEND_MULTIPLE)

instead setAction(Intent.ACTION_SEND)

to send (or share) multiple files.



It was asked 6 months ago, so I don't know how relevant this is for you now. But maybe it can help someone else. :)

+1


source







All Articles