I\'m taking a picture on Android Nougat with FileProvider, that\'s my code
The main thing to get camera and gallery URI working is provider paths.
you need to create a provider_paths.xml to /res/xml/ dir
In your manifest file add this lines between
One more thing, I've found that we need to set vmPolicy in Application class like this
@Override
public void onCreate() {
super.onCreate();
//Allowing Strict mode policy for Nougat support
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
}
Double check your camera and external storage permission in manifest file and there you go with nougat URI.
For more details check this link : Android N FileUriExposedException