Created
February 12, 2020 01:07
-
-
Save JosiasSena/8b0be44f5b8b90147f6c114bd7546a2c to your computer and use it in GitHub Desktop.
Fixed getCameraIds()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void getCameraIds() { | |
cameraManager = (CameraManager) appContext.getSystemService(Context.CAMERA_SERVICE); | |
CameraCharacteristics cameraCharacteristics; | |
try { | |
for (String cameraId : cameraManager.getCameraIdList()) { | |
cameraCharacteristics = cameraManager.getCameraCharacteristics(cameraId); | |
if (isCameraFacingBack(cameraCharacteristics) && backCameraId == null) { | |
backCameraId = cameraId; | |
} else if (isCameraFacingFront(cameraCharacteristics) && frontCameraId == null) { | |
frontCameraId = cameraId; | |
} | |
} | |
} catch (CameraAccessException exception) { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment