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
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.