android 相机报错 setParameters failed

   List sizeList = parameters.getSupportedPreviewSizes();

  int PreviewWidth = 640;

  int PreviewHeight = 480;

  Boolean findSize = false;

  if (sizeList.size() > 1) {

  Iterator itor = sizeList.iterator();

  while (itor.hasNext()) {

  Camera.Size cur = itor.next();

  if (cur.width >= PreviewWidth

  && cur.height >= PreviewHeight) {

  findSize = true;

  PreviewWidth = cur.width;

  PreviewHeight = cur.height;

  break;

  }

  }

  }

  if (!findSize) {

  PreviewWidth = sizeList.get(0).width;

  PreviewHeight = sizeList.get(0).height;

  }

  parameters.setPreviewSize(PreviewWidth, PreviewHeight);

时间: 2024-11-02 17:35:15

android 相机报错 setParameters failed的相关文章

android开发-android.net.nsd 发现服务时随机重启报错 dequeueBuffer failed

问题描述 android.net.nsd 发现服务时随机重启报错 dequeueBuffer failed 小弟最近在做安卓的开发,用了android.net.nsd的服务注册与发现.在模拟器上调试的时候没有发现任何问题.但是将demo放到智能电视的时候出了问题.程序有时正常有时会重启.进过不断的调试发现是在启动NSD服务发现的时候报错了. 报错信息如下: 09-30 15:10:56.760: I/sg_life(11572): start discover-- 09-30 15:10:56.

ubuntu 系统下运行android虚拟机报错如下,怎么回事呢

问题描述 ubuntu 系统下运行android虚拟机报错如下,怎么回事呢 Starting emulator for AVD 'test' X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 154 (GLX) Minor opcode of failed request: 19 (X_GLXQueryServerStr

求大神看看 unity导出android工程报错!!急!!!!

问题描述 求大神看看 unity导出android工程报错!!急!!!! CommandInvokationFailure: Android Asset Packaging Tool failed. See the Console for details. E:adt-bundle-windows-x86_64-20140702sdkbuild-tools21.1.1aapt.exe package -v -f -F raw.ap_ -A raw -0 """" s

sdk-android报错:Failed to allocate memory: 8

问题描述 android报错:Failed to allocate memory: 8 从今天开始,当我想要再NetBeans运行一个应用程序的时候,就显示下边的错误: Failed to allocate memory: 8 This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more inf

mvn打包报错:Failed to load ApplicationContext

问题描述 mvn打包报错:Failed to load ApplicationContext ApplicationContext中扫描的包: /context:component-scan springmvc.xml中扫描的包: <context:component-scan base-package="com.aa.controller" /> 解决方案 问题已解决,pom配置文件中没有配置加载resources,所以加载不到resources目录下面的配置文件!加上配

Android Studio 报错“app:processDebugResources"解决方法

Android Studio 报错"app:processDebugResources"解决方法 Android Studio项目Build的时候报了这么一个错误: Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Pro

android cts 报错 Android!

问题描述 android cts 报错 Android! 这种报错通常是什么 有没有什么共性 求大虾 指导一下 at com.android.tradefed.testtype.DeviceTestResult$1.protect(DeviceTestResult.java:81) at com.android.tradefed.testtype.DeviceTestResult.runProtected(DeviceTestResult.java:56) at com.android.trad

android studio 报错,请问这是怎么回事?怎么解决

问题描述 android studio 报错,请问这是怎么回事?怎么解决 Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.qihoo.sdk.report.b) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by

nginx-Nginx报错 malloc failed

问题描述 Nginx报错 malloc failed Nginx 版本:1.9.6.1 一开始那几天还好,最近几天经常报内存不足的错误,而且是不稳定重现, 贴上配置,服务器配置:16核32G windows 2008 #user nobody; worker_processes 8; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/ngin