I am facing a problem with flipping the from front to back in android with in the button onClickListener.
Here is my code.
MainActivity.java <
Finally, i found the solution for the problem. Here is my modification to flip the camera
private void flipcamera() {
if (camera != null)
{
System.out.println("flipcamera");
camera.stopPreview();
camera.release();
camera = null;
}
camera = Camera.open(camFront);
if (camera != null) {
try {
camera.setPreviewDisplay(sHolder.getHolder());
camera.startPreview();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Thanks guys.