Skip to content
Advertisement

How to share image via intent in android 10

I’m fetching an image from a URL as a bitmap using glide, and onResourceReady() I’m trying to share the image via intent, but I’m getting an exception. I’m using Android 30.

JavaScript

My method for providing file URI. Source

JavaScript

MY Error

JavaScript

I also tried using the IntentShare Library

JavaScript

But there I was getting an error that content Uri is needed.

JavaScript

Advertisement

Answer

Well here is how I got it resolved, first add this provider tag in your manifest

JavaScript

then create a new xml file under res/xml/ named filepaths.xml Source

JavaScript

my method for providing file provider uri

JavaScript

finally the glide with Read URI flag set in intent

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement