How can I serve files from the SECONDARY external storage using the FileProvider
?
The current implementation of the FileProvider
handles on
So I ended up doing the following:
Try to create to Uri via FileProvider, If it fails due to:
java.lang.IllegalArgumentException: Failed to find configured root that contains
I'm just creating a regular Uri.
Here's my code:
try {
uri = FileProvider.getUriForFile(context,
MY_AUTHORITY_STRING,
imageFile);
} catch (Exception e) {
CLog.d(TAG, e);
uri = Uri.fromFile(imageFile);
}
I don't know why, but it's working, the FileProvider can't access the file (As it's in secondary external storage) and then the uri is created successfully in the catch clause.
Weird Google...very weird.