Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tdao1611 opened this issue Aug 26, 2015 · 2 comments

Comments

@tdao1611
Copy link

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 ?

@Kabir121
Copy link

Kabir121 commented Jan 9, 2016

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

@Montsserrat
Copy link

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants