gpt4 book ai didi

android - 相机获取参数失败

转载 作者:行者123 更新时间:2023-12-04 18:07:52 29 4
gpt4 key购买 nike

该代码在三星手机上正常运行。但是手机 HTC ONE 和许多其他手机应用程序在调用以下方法时崩溃 camera.getParameters()

日志:

java.lang.RuntimeException: getParameters failed (empty parameters)
at android.hardware.Camera.native_getParameters(Native Method)
at android.hardware.Camera.getParameters(Camera.java:1460)
at com.bumsun.trollface.MainActivity$8.onCheckedChanged(MainActivity.java:136)
at android.widget.CompoundButton.setChecked(CompoundButton.java:126)
at android.widget.Switch.setChecked(Switch.java:688)
at android.widget.Switch.animateThumbToCheckedState(Switch.java:679)
at android.widget.Switch.stopDrag(Switch.java:669)
at android.widget.Switch.onTouchEvent(Switch.java:629)
at android.view.View.dispatchTouchEvent(View.java:7127)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1925)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1379)
at android.app.Activity.dispatchTouchEvent(Activity.java:2396)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1873)
at android.view.View.dispatchPointerEvent(View.java:7307)
at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3174)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3119)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4157)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4136)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4228)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:125)
at android.os.Looper.loop(Looper.java:124)
at android.app.ActivityThread.main(ActivityThread.java:4800)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)

最佳答案

if (mCamera == null) 
return; //don't write anything between these two lines, previously I got this error, because I put a log out.
Camera.Parameters lParameters = mCamera.getParameters();

关于android - 相机获取参数失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22429072/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com