CameraFragment
CameraFragment copied to clipboard
Camera capture not happening.
While the device is moving if we click capture button, then the camera capture not happening. Mostly observed in OS version pie, Handsets observed is Poco and OnePlus. But if we keep the device to upside down with camera facing ground or cover with the hand the capture happens. but we get a black image.
@Override public void takePhoto(File photoFile, CameraPhotoListener cameraPhotoListener, CameraFragmentResultListener callback) { this.outputPath = photoFile; this.cameraPhotoListener = cameraPhotoListener; this.callback = callback;
backgroundHandler.post(new Runnable() {
@Override
public void run() {
lockFocus();
}
});
}
lockFocus() doesnot get called. final CameraFragmentApi cameraFragment = getCameraFragment();
if (cameraFragment != null) {
cameraFragment.takePhotoOrCaptureVideo(new CameraFragmentResultAdapter() {
@Override
public void onVideoRecorded (String filePath) {
}
@Override
public void onPhotoTaken (byte[] bytes, String filePath) {
}
onPhotoTaken not getting called.