我在调用斑马线图书馆时遇到了崩溃, 我眼镜的屏幕尺寸是428/240, 这是我的简单电话
Intent i = new Intent(this, CaptureActivity.class);
i.setAction("com.google.zxing.client.android.SCAN");
i.putExtra("SCAN_MODE", "EAN_13,CODE_128");
startActivityForResult(i, 0);
这是我得到的错误,
01-01 02:28:13.726: E/CameraHal(127): (1d99b30) hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:1185 setFormat - OMX_SetParameter - 80001001
01-01 02:28:13.726: E/CameraHal(127): (1d99b30) hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:1246 setFormat - Exiting function setFormat because of eError = 0x80001001
01-01 02:28:13.726: E/CameraHal(127): (1d99b30) hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXAlgo.cpp:1133 setSensorOrientation - Error while configuring format 0xffffffea
01-01 02:28:13.726: E/CameraHal(127): (1d99b30) hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:2816 getFrameSize - Error configuring Sensor Orientation ffffffea
01-01 02:28:13.726: E/CameraHal(127): (1d99b30) hardware/ti/omap4xxx/camera/CameraHal.cpp:1808 cameraPreviewInitialization - Error: CAMERA_QUERY_RESOLUTION_PREVIEW -22
01-01 02:28:13.734: W/CaptureActivity(2639): Unexpected error initializing camera
01-01 02:28:13.734: W/CaptureActivity(2639): java.lang.RuntimeException: startPreview failed
01-01 02:28:13.734: W/CaptureActivity(2639): at android.hardware.Camera.startPreview(Native Method)
01-01 02:28:13.734: W/CaptureActivity(2639): at com.google.zxing.client.android.camera.CameraManager.startPreview(CameraManager.java:151)
01-01 02:28:13.734: W/CaptureActivity(2639): at com.google.zxing.client.android.CaptureActivityHandler.<init>(CaptureActivityHandler.java:74)
01-01 02:28:13.734: W/CaptureActivity(2639): at com.google.zxing.client.android.CaptureActivity.initCamera(CaptureActivity.java:688)
01-01 02:28:13.734: W/CaptureActivity(2639): at com.google.zxing.client.android.CaptureActivity.surfaceCreated(CaptureActivity.java:386)
01-01 02:28:13.734: W/CaptureActivity(2639): at android.view.SurfaceView.updateWindow(SurfaceView.java:536)
01-01 02:28:13.734: W/CaptureActivity(2639): at android.view.SurfaceView.access$000(SurfaceView.java:82)
01-01 02:28:13.734: W/CaptureActivity(2639): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:170)
01-01 02:28:13.734: W/CaptureActivity(2639): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:590)
01-01 02:28:13.734: W/CaptureActivity(2639): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1617)
01-01 02:28:13.734: W/CaptureActivity(2639): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
01-01 02:28:13.734: W/CaptureActivity(2639): at android.os.Handler.dispatchMessage(Handler.java:99)
01-01 02:28:13.734: W/CaptureActivity(2639): at android.os.Looper.loop(Looper.java:137)
01-01 02:28:13.734: W/CaptureActivity(2639): at android.app.ActivityThread.main(ActivityThread.java:4424)
01-01 02:28:13.734: W/CaptureActivity(2639): at java.lang.reflect.Method.invokeNative(Native Method)
01-01 02:28:13.734: W/CaptureActivity(2639): at java.lang.reflect.Method.invoke(Method.java:511)
01-01 02:28:13.734: W/CaptureActivity(2639): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-01 02:28:13.734: W/CaptureActivity(2639): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-01 02:28:13.734: W/CaptureActivity(2639): at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:4)
我已经硬编码了相机的PreviewSize。 在CameraConfigurationManager中,更改:
parameters.setPreviewSize(cameraResolution.x, cameraResolution.y);
//change into
parameters.setPreviewSize(1280, 720);
答案 1 :(得分:1)
这是眼镜中的驱动程序或硬件错误,如堆栈跟踪所示。它与应用程序无关。您可以分析驱动程序错误,并可能将其报告给制造商。另外,请尝试禁用“错误”解决方法&#39;应用程序中的选项可以避免常见的驱动程序错误。