public static Intent getCameraCaptureIntent ( Context ctx , String authority ) { Intent intent = new Intent ( MediaStore . ACTION_IMAGE_CAPTURE ) ; try { // Get the app's local file storage mCurrentCaptureUri = createAccessibleTempFile ( ctx , authority ) ; grantPermissions ( ctx , mCurrentCaptureUri ) ; intent . putExtra ( MediaStore . EXTRA_OUTPUT , mCurrentCaptureUri ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return intent ; }
Generate the appropriate intent to launch the existing camera application to capture an image