Home | History | Annotate | Download | only in runtimepermissions

Lines Matching refs:CAMERA

32 import com.example.android.system.runtimepermissions.camera.CameraPreviewFragment;
40 * This Activity requests permissions to access the camera ({@link android.Manifest.permission#CAMERA})
41 * when the 'Show Camera' button is clicked to display the camera preview.
71 * For example the camera cannot be opened or an empty list of contacts is returned. No special
82 * Id to identify a camera permission request.
103 * Called when the 'show camera' button is clicked.
107 Log.i(TAG, "Show camera button pressed. Checking permission.");
109 // Check if the Camera permission is already available.
110 if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
112 // Camera permission has not been granted.
118 // Camera permissions is already available, show the camera preview.
120 "CAMERA permission has already been granted. Displaying camera preview.");
128 * Requests the Camera permission.
133 Log.i(TAG, "CAMERA permission has NOT been granted. Requesting permission.");
137 Manifest.permission.CAMERA)) {
142 "Displaying camera permission rationale to provide additional context.");
149 new String[]{Manifest.permission.CAMERA},
156 // Camera permission has not been granted yet. Request it directly.
157 ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA},
164 * Called when the 'show camera' button is clicked.
227 * Display the {@link CameraPreviewFragment} in the content area if the required Camera
259 // Received permission result for camera permission.
260 Log.i(TAG, "Received response for Camera permission request.");
264 // Camera permission has been granted, preview can be displayed
265 Log.i(TAG, "CAMERA permission has now been granted. Showing preview.");
269 Log.i(TAG, "CAMERA permission was NOT granted.");