问题描述
我复制从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
的Camera.Parameters目的是通过Camera.getParameters.
这篇关于RuntimeException的上Camera.setParameters()在Nexus One的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!