Order the steps
Order the steps to request the camera permission well.
- If
shouldShowRequestPermissionRationaleis true, explain why - If denied permanently, offer a Settings link
- Check
checkSelfPermission; if granted, open the camera - User taps 'Scan receipt'
- Launch the permission request
Choose an answer, then open Show answer below to check it.
Show answer
Answer: D C A E B
- User taps 'Scan receipt' Ask in context, when the feature is used.
- Check
checkSelfPermission; if granted, open the camera No dialog if you already have it. - If
shouldShowRequestPermissionRationaleis true, explain why Users who denied once get a reason. - Launch the permission request The system dialog appears.
- If denied permanently, offer a Settings link The system won't show the dialog again.