I have developed an application which captures a photo when punch in at the time. It\'s working good on Acer tab(capturing image and saves in sdcard). Now when I run the sam
It is not working in all cases. You call getSupportedPictureSizes()
then you can get the list. And choose parameters in setPictureSize()
from the list.
private void flipBackToFrontCamera() {
if (mCamera != null) {
mCamera.stopPreview();
mCamera.release();
mCamera = null;
}
mCamera = Camera.open(1);
if (mCamera != null) {
try {
mCamera.setPreviewDisplay(surfaceView.getHolder());
mCamera.startPreview();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Call the startPreview method before you call takePicture method camera.takePicture(null, null, mCall);
and the startPreview method I used is
private void startPreview() {
if (cameraConfigured && camera!=null) {
camera.startPreview();
inPreview=true;
}
}
and through this I solved my issue... It may help you guys.