Replace new File(uri)
with new File(Uri.parse(uri).getPath())
in your FileProvider.getUriForFile()
call. The value that you get from local_uri
appears to be a Uri
, with a file
scheme.
Also, depending upon the rest of the Uri
, you may need to replace external-files-path
with external-path
.
manpreet
Best Answer
2 years ago
I am trying to open the file downloaded by
DownloadManager
. I registered aBroadcastReceiver
with actionDownloadManager.ACTION_DOWNLOAD_COMPLETE
.Here's the
onReceive
method of my receiver-Here is the
provider
tag in myAndroidManifest.xml
file -