Skip to content Skip to sidebar Skip to footer

Android: Getting Image Bitmap From Third Party App (e.g. Whatsapp) Via Content:// Uri

I am trying to get image from third party app (e.g WhatsApp) to my app (being tested on Marshmallow). When I do 'share image' from WhatsApp and share it with my app, I get URI some

Solution 1:

Ok. I found where was the problem. In my app's initial activity I was storing content URI (Which I got from third party app like WhatsApp or Chrome etc. for e.g. content://com.whatsapp.provider.media/item/61025) in an array and was accessing it from other activity.

That was not correct. I got hint from this answer and I called getContentResolver().openInputStream(uri) right from the app's launcher activity immediately after I get shared contents. And it worked, didn't throw any exception.

Post a Comment for "Android: Getting Image Bitmap From Third Party App (e.g. Whatsapp) Via Content:// Uri"