The path of that file begins exactly with what getExternalFilesDir(Environment.DIRECTORY_PICTURES) returns.
AFAIK, that will not give you a directory named SpCars_album/
.
I just cant understand what raises the error because everything seems to fit.
The file you supplied is not one that can be served by the FileProvider
from your defined roots.
UPDATE
I forgot that this is tied to a documentation bug on FileProvider
. FileProvider
and <external-path>
does NOT serve files from getExternalFilesDir()
, but instead from Environment.getExternalStorageDirectory()
. I created a StreamProvider
subclass that offers support for getExternalFilesDir()
.
If you use my StreamProvider
, replacing your <external-path>
with <external-files-path name="myexternalimages" path="Pictures/SpCars_album/" />
, you should have better luck.