Basic camera app - works on most phones but some users are getting one
or other of these two exceptions :
Exception Details: java.io.IOException: takePicture failed
at android.hardware.Camera.native_takePicture(Native Method)
at android.hardware.Camera.takePicture(Camera.java:362)
Exception Details: java.io.IOException: startPreview failed
at android.hardware.Camera.startPreview(Native Method)
I am using all standard camera code in terms of when to open camera,
startpreview, stoppreview, takepicture, etc :
public void surfaceCreated(SurfaceHolder holder) {
mCamera = Camera.open();
mCamera.setPreviewDisplay(holder);
}
public void surfaceDestroyed(SurfaceHolder holder) {
mCamera.stopPreview();
mCamera.release();
mCamera = null;
}
public void surfaceChanged(SurfaceHolder holder, int format, int
w, int h) {
Camera.Parameters parameters = mCamera.getParameters();
parameters.setPreviewSize(w, h);
mCamera.setParameters(parameters);
mCamera.startPreview();
}
public boolean onKeyDown(int keyCode, KeyEvent event)
{
mPreview.mCamera.takePicture
(mShutterCallback,mPictureCallbackRaw,mPictureCallbackJpeg);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---