imageUrl = FileProvider.getUriForFile(MainActivity.this,"com.example.cameraalbumtest.fileprovider",outputImage);
《manifest》
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.example.cameraalbumtest.fileprovider"
android:exported="false"
android:grantUrlPermissions="true">
<Meta - data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"/>
</provider>
《file_paths.xml》
<paths xmlns:android="http://schemas.android.com/apk/res/android"> <external-path path="Android/data/com.santong.party/" name="files_root" /> /> </paths>