private static Uri createAccessibleTempFile ( Context ctx , String authority ) throws IOException { File dir = new File ( ctx . getCacheDir ( ) , "camera" ) ; File tmp = createTempFile ( dir ) ; // Give permissions return FileProvider . getUriForFile ( ctx , authority , tmp ) ; }
Generate an accessible temporary file URI to be used for camera captures