我正在使用Android Intent.ActionImageCapture启动一个基本的相机应用程序,StartActivityForResult()启动相机应用程序,但在拍摄图像之前它会崩溃。
logcat中的异常是java.lang.runtime停止面部检测失败。
我没有使用面部检测,也没有必要。并且无法处理此错误。
到目前为止,这个问题发生在6.0.1中,但对于低于和高于6的版本可以正常工作。
这是代码:
Intent intent = new Intent(MediaStore.ActionImageCapture);
Java.IO.File _file = new Java.IO.File(m_cameraPhotosFolder, String.Format("mosaicfile_{0}.jpg", Guid.NewGuid()));
// Tell Camera where to save image
m_currentPhotoFileName = _file.AbsolutePath;
intent.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(_file));
StartActivityForResult(intent, 0);
logcat的:
V/CAM_PhotoModule( 8729): Close camera device.
E/CAM_AndroidCameraManagerImpl( 8729): Stopping face detection failed, ignoring.
E/CAM_AndroidCameraManagerImpl( 8729): java.lang.RuntimeException: stop face detection failed
E/CAM_AndroidCameraManagerImpl( 8729): at android.hardware.Camera._stopFaceDetection(Native Method)
E/CAM_AndroidCameraManagerImpl( 8729): at android.hardware.Camera.stopFaceDetection(Camera.java:1751)
E/CAM_AndroidCameraManagerImpl( 8729): at com.android.camera.AndroidCameraManagerImpl$CameraHandler.stopFaceDetection(SourceFile:138)
E/CAM_AndroidCameraManagerImpl( 8729): at com.android.camera.AndroidCameraManagerImpl$CameraHandler.handleMessage(SourceFile:337)
E/CAM_AndroidCameraManagerImpl( 8729): at android.os.Handler.dispatchMessage(Handler.java:102)
E/CAM_AndroidCameraManagerImpl( 8729): at android.os.Looper.loop(Looper.java:148)
E/CAM_AndroidCameraManagerImpl( 8729): at android.os.HandlerThread.run(HandlerThread.java:61)
I/MtkCam/Cam1Device( 307): (1057)(Default:0)[Cam1DeviceBase::stopPreview] +
I/MtkCam/CamAdapter( 307): (MtkZsd)[BaseCamAdapter::onImgBufProviderDestroyed] id=4, ImgBufProvider=0x0
W/MtkCam/CamClient/FDClient( 307): (1057)[stopFaceDetection] FD was not running
I/MtkCam/CamAdapter( 307): (MtkZsd)[BaseCamAdapter::onImgBufProviderDestroyed] id=5, ImgBufProvider=0x0
W/MtkCam/CamClient/OTClient( 307): (1057)[stopOT] OT was not running
I/MtkCam/Cam1Device( 307): (1057)(Default:0)[Cam1DeviceBase::stopPreview] -
I/MtkCam/DisplayClient( 307): [uninit] + getStrongCount(2)
I/MtkCam/CamAdapter( 307): (MtkZsd)[BaseCamAdapter::onImgBufProviderDestroyed] id=1, ImgBufProvider=0xd9eaba90