我有一个自定义相机应用程序,但当我尝试拍照时它崩溃了!我正在使用5.1.1版本的S6进行测试并且它不起作用但是当我在带有5.0.1版本的note3中进行测试时,它有用吗,
这是我的错误日志:
09-12 16:47:39.851: E/AndroidRuntime(12778): Process: com.example.hamom, PID: 12778
09-12 16:47:39.851: E/AndroidRuntime(12778): java.lang.RuntimeException: takePicture failed
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.hardware.Camera.native_takePicture(Native Method)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.hardware.Camera.takePicture(Camera.java:1484)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.hardware.Camera.takePicture(Camera.java:1429)
09-12 16:47:39.851: E/AndroidRuntime(12778): at com.example.hamom.CameraPreview.capture(CameraPreview.java:213)
09-12 16:47:39.851: E/AndroidRuntime(12778): at com.example.hamom.CameraFragment$3.onTouch(CameraFragment.java:129)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.View.dispatchTouchEvent(View.java:9144)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2687)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2362)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2687)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2362)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2687)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2362)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2687)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2362)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2687)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2362)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2687)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2362)
09-12 16:47:39.851: E/AndroidRuntime(12778): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2740)
09-12 16:47:39.851: E/AndroidRuntime(12778): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1832)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.app.Activity.dispatchTouchEvent(Activity.java:2944)
09-12 16:47:39.851: E/AndroidRuntime(12778): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2701)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.View.dispatchPointerEvent(View.java:9360)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4978)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4739)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4271)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4324)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4290)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4416)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4298)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4473)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4271)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4324)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4290)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4298)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4271)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6866)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6747)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6718)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6956)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:6927)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:6979)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.Choreographer.doCallbacks(Choreographer.java:590)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.Choreographer.doFrame(Choreographer.java:558)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.os.Handler.handleCallback(Handler.java:739)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.os.Handler.dispatchMessage(Handler.java:95)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.os.Looper.loop(Looper.java:145)
09-12 16:47:39.851: E/AndroidRuntime(12778): at android.app.ActivityThread.main(ActivityThread.java:6837)
09-12 16:47:39.851: E/AndroidRuntime(12778): at java.lang.reflect.Method.invoke(N