Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void TryOpenCamera()
- {
- if((int) Build.VERSION.SdkInt < 23)
- {
- dispatchTakePictureIntent();
- return;
- }
- GetCameraPermission();
- }
- private void GetCameraPermission()
- {
- const string permission = Manifest.Permission.WriteExternalStorage;
- if (CheckSelfPermission(permission) == (int)Permission.Granted)
- {
- dispatchTakePictureIntent();
- return;
- }
- if (ShouldShowRequestPermissionRationale(permission))
- {
- //// Explain to the user why we need this permission
- //Snackbar.Make(layout, "Camera access is required to take profile ", Snackbar.LengthIndefinite)
- // .SetAction("Ok", v => RequestPermissions(CameraPermissions, RequestCameraId))
- // .Show();
- return;
- }
- }
Add Comment
Please, Sign In to add comment