11-11 20:13:39.831: W/Camera(767): ICamera died
11-11 20:13:39.831: W/Camera(767): Camera server died!
11-11 20:13:39.842: E/Camera(767): Error 100
你好我一直在研究这个问题。我在Manifest文件中正确设置了所有权限,并且正在执行正确的Camera.open并设置Camera.com示例中的CameraPreview(Surface View)。但是,在以下CameraPreview类的方法中调用startPreview()
方法时,我不断收到Camera server错误。
有什么想法吗?我已经在网上搜索了解决方案,直到onResume和Camera成功打开之后才调用此方法。
//method of CameraPreview (extends SurfaceView implements SurfaceHolder.Callback)
//that is associated with a view added to a FrameLayout in my App
public void surfaceCreated(SurfaceHolder holder) {
// The Surface has been created, now tell the camera where to draw the preview.
try {
mCamera.setPreviewDisplay(holder);
mCamera.startPreview();//HERE IS WHERE IT IS CAUSING ERROR!!!!!
} catch (IOException e) {
// Log.d(TAG, "Error setting camera preview: " + e.getMessage());
System.err.println("Error setting camera preview: " + e.getMessage());
}
}