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
3 years ago
I am trying to open the file downloaded by
DownloadManager. I registered aBroadcastReceiverwith actionDownloadManager.ACTION_DOWNLOAD_COMPLETE.Here's the
onReceivemethod of my receiver-Here is the
providertag in myAndroidManifest.xmlfile -