CameraModule icon indicating copy to clipboard operation
CameraModule copied to clipboard

I tried to switch the camera from "back" to "front" but still got errors.

Open tdao1611 opened this issue 10 years ago • 2 comments

Right now I tried to use "intent" to recreate the activity with FRONT_CAMERA set to true so that I can switch the camera but it causes a lot of bugs. Do you have an easier way for this ?

tdao1611 avatar Aug 26 '15 06:08 tdao1611

Yep I can't take images through front camera for samsung devices. It says "camera.setParameters failed in android"

Kabir121 avatar Jan 09 '16 23:01 Kabir121

In my case I resolved with : camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_BACK); You can change it for : camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT);

@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); boolean useFrontCamera = getArguments().getBoolean(FRONT_CAMERA, false); camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_BACK); // <-- THIS LINE //camera = getCameraInstance(useFrontCamera); if (camera == null) { return; } initScreenParams(); parameters = camera.getParameters();

Montsserrat avatar Nov 01 '17 21:11 Montsserrat