我有一个适用于大多数手机的相机应用程序,但今天我收到用户的错误消息。该错误表明应用程序在Camera.setParameters()上崩溃我已阅读ThisStackOverflowPost关于该主题,但已经实现了相同的解决方案。这是我使用的代码:publicvoidsurfaceChanged(SurfaceHolderholder,intformat,intw,inth){camera.setDisplayOrientation(90);Camera.Parametersparameters=camera.getParameters();Camera.Sizesize=getBest
从方法surfaceChanged()调用Camera.setParameters()时出现RuntimeException错误。我看到其他帖子也有同样的问题,但没有找到明确的解决方案:Issuewithsettingtheparameterstocamera我的问题是:为什么要在surfaceCreated()之后立即调用surfaceChanged()?在surfaceCreated()中启动预览是违反直觉的(至少对我而言),只是停止它并在surfaceChanged()中重新启动另一个预览。第一次调用surfaceChanged()时,传入的宽高是什么决定的?正如上述帖子中所建议
我在我的应用程序中包含了相机功能。我还在市场上推出了该应用程序。我从其中一位用户那里收到一条错误消息,说他在打开相机时遇到了错误。我已经在2.1的设备上测试了该应用程序。我从用户那里得到的错误是使用nexusone,它主要运行2.2...这是我收到的logcat错误...java.lang.RuntimeException:setParametersfailedatandroid.hardware.Camera.native_setParameters(NativeMethod)atandroid.hardware.Camera.setParameters(Camera.java:64
我在我的应用程序中包含了相机功能。我还在市场上推出了该应用程序。我从其中一位用户那里收到一条错误消息,说他在打开相机时遇到了错误。我已经在2.1的设备上测试了该应用程序。我从用户那里得到的错误是使用nexusone,它主要运行2.2...这是我收到的logcat错误...java.lang.RuntimeException:setParametersfailedatandroid.hardware.Camera.native_setParameters(NativeMethod)atandroid.hardware.Camera.setParameters(Camera.java:64
我使用this创建了一个自定义相机应用程序源代码,但在少数设备上(如高分辨率设备)我得到:RuntimeExceptionsetParametersfailed我正面临这个异常(exception),因为:params.setPictureSize(1200,900);我注意到,如果我使用(1600,1200)而不是(1200,900)那么我就不会遇到这样的问题日志:11-0711:45:20.630:E/AndroidRuntime(3827):FATALEXCEPTION:main11-0711:45:20.630:E/AndroidRuntime(3827):java.lang.