Skip to content Skip to sidebar Skip to footer

Android Share Intent Extra_stream

I have this method that shares a textfile or a picture depending of which EXTRA_STREAM I'm using. I have these two I can choose from i.putExtra(Intent.EXTRA_STREAM, uri); i.putExtr

Solution 1:

Check this out and this out

A content Uri is all you need. There is no need to use a file Uri.

In future other apps may want to avoid READ_EXTERNAL_STORAGE which is required to read File Uri's. So you may avoid them.


If you just want to share files with different type, use ACTION_SEND_MULTIPLE

intent.setAction(Intent.ACTION_SEND_MULTIPLE);
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, yourUriArrayList);
intent.setType("*/*");

Post a Comment for "Android Share Intent Extra_stream"