RuntimeException的上Camera.setParameters()在Nexus One [英] RuntimeException on Camera.setParameters() on nexus one

查看:137
本文介绍了RuntimeException的上Camera.setParameters()在Nexus One的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我复制从code <一个href="http://stackoverflow.com/questions/1048739/android-camera-set$p$pviewdisplay-problem/1048844#1048844">the回答这里,我还是我得到一个RuntimeException:setParameters我的Nexus One失败的错误。我的清单文件有摄像头和WAKE_LOCK权限。这个工程在模拟器上,并在机器人我没有得到错误,但它确实有一个旋转的问题。

I copied the code from the answer here and I still am getting a RuntimeException: setParameters failed error on my nexus one. My manifest file has camera and wake_lock permissions. This works on the emulator, and on the droid I don't get the error but it does have a rotation problem.

推荐答案

你最有可能requsting无效preVIEW大小。如果检查亚行logcat的结果你可能会看到这样的内容:

You're most likely requsting an invalid preview size. If you check the results of adb logcat you'll probably see something like this:

E/QualcommCameraHardware(22732): Invalid preview size requested: 480x724

解决方案是要求最近的可用preVIEW大小与一个你想;您可以在获得可用preVIEW尺寸列表通过调用 getSupported previewSizes 的<一个href="http://developer.android.com/reference/android/hardware/Camera.Parameters.html">Camera.Parameters目的是通过<返回的href="http://developer.android.com/reference/android/hardware/Camera.html#getParameters()">Camera.getParameters.

这篇关于RuntimeException的上Camera.setParameters()在Nexus One的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆