Hello,
I have an application that uses the camera to take pictures. It is
currently compiled for level 4 (or version 1.6 of the firmware).
Everything works great when I run it in the emulator for 1.6 or on my
phone running 1.6. But when I run it on the emulator for 2.0, it
appears as if the autofocuscallback method is never called.
The code calling the autofocus is:
try {
Log.d("CameraManager", "On keydown called with
KeyEvent.Keycode_dpad_center");
Camera.Parameters params = mCamera.getParameters();
params.setPictureFormat(PixelFormat.JPEG);
params.setPictureSize(PHOTO_WIDTH,PHOTO_HEIGHT);
params.set("rotation",90);
mCamera.setParameters(params);
mCamera.autoFocus(autoFocusCallback);
return true;
} catch ...
The autofocuscallback is as follows:
private final Camera.AutoFocusCallback autoFocusCallback = new
Camera.AutoFocusCallback() { public void onAutoFocus(boolean
success, Camera camera) {
Log.d("CameraManager", "On autofocus called");
if (success) {
Log.d("CameraManager", "Camera successfully autofocused");
camera.takePicture(mShutterCallback, null, mPictureCallback);
}
else {
Log.d("CameraManager", "Camera FAILED to autofocus");
}
} };
While the log message at the top of the code appears every time I
press the dpad button on 2.0, the autofocus log message never
appears.
No doubt I'm doing something boneheaded.
Thanks in advance for your assistance.
Mark
--
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