惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
S
Security @ Cisco Blogs
V
Visual Studio Blog
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
云风的 BLOG
云风的 BLOG
小众软件
小众软件
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
爱范儿
爱范儿
B
Blog RSS Feed
Recorded Future
Recorded Future
The GitHub Blog
The GitHub Blog
宝玉的分享
宝玉的分享
博客园 - 司徒正美
U
Unit 42
G
Google Developers Blog
博客园 - Franky
阮一峰的网络日志
阮一峰的网络日志
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
博客园 - 【当耐特】
腾讯CDC
博客园 - 聂微东
IT之家
IT之家
Martin Fowler
Martin Fowler
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
The Register - Security
The Register - Security
PCI Perspectives
PCI Perspectives
C
Check Point Blog
AI
AI
Webroot Blog
Webroot Blog
I
Intezer
博客园 - 三生石上(FineUI控件)
Google DeepMind News
Google DeepMind News
L
LangChain Blog
C
Cybersecurity and Infrastructure Security Agency CISA
S
Schneier on Security
C
CERT Recently Published Vulnerability Notes
Forbes - Security
Forbes - Security
S
Secure Thoughts
Y
Y Combinator Blog
Google Online Security Blog
Google Online Security Blog
H
Heimdal Security Blog
有赞技术团队
有赞技术团队
L
Lohrmann on Cybersecurity

博客园 - 自由程序员2006

股市赚钱就是这么简单 四角号码查询器手机版 解决 HttpWebResponse.GetResponse()一直提示超时 解决Oracle登录极慢的问题 分享 百度网盘,不用开会员也可以免费同步上传视频和照片的方法 广电的宽带网络真流氓,替换google的广告为百度的广告 Android下WPS打开Excel2007版也有问题 微软官方的Excel android 移动版的折腾 分享vs低版本开发的项目到VS高版本时遇到的4个小问题解决之记录 解决System.Runtime.CompilerServices.ExtensionAttribute..ctor 与 ‘ExtensionAttribute’ is ambiguous in the namespace ‘System.Runtime.CompilerServices’ 问题 解决 在Android开发上使用KSOAP2上传大图片到服务器经常报错的问题 解决微云登陆出现wns login error的问题 终于可以随意控制孩子玩手机的时间了 Android项目,从web上取下汉字,中文部分乱码 There is no ‘Animation’ attached to the “Player” game object Consider this problem again and again, resolve that AndEngine not run in AVD Finally <<Learning Android Game Programming>> need update 今天很兴奋。看到了2个激动人心的技术 编程难不难?
解决Android调用相机拍照,要报“打开相机失败”查看debug日志显示“setParameters failed”的问题
自由程序员2006 · 2019-12-05 · via 博客园 - 自由程序员2006

使用CameraLibrary项目,在部分手机或平板上不能正常使用,要报“打开相机失败”查看debug日志显示“setParameters failed”。

找到CameraView.java中的setCameraParameters方法,注释掉

//自动聚焦模式

//parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);

parameters是Camera.Parameters类型的。

即可,看来是这部分不能正常使用摄像头的手机、平板,是不支持自动聚集模式,或是这种调用方式。

另外,eclipse或android studio IDE已经在提示这些调用方法过时了,但怎么用最新的,还请自己查一下。就用老的,也可以用。

20191212更新:

刚才,同事反馈,又出问题了,就因为改了一下其他地方,加了个字段,不应该影响到相机拍照啊。各种排除,最后还是找到原因了。

不止要注释掉前面那行设置参数的,还要注释掉另两行设置参数的。

//设置闪光灯模式。此处主要是用于在相机摧毁后又重建,保持之前的状态
//setFlashMode(mFlashMode);
//设置缩放级别
//setZoom(mZoom);
//开启屏幕朝向监听

把它们也注释掉,正常了。

华为的新平板,就是有这问题,老平板,都是正常的。

原文首发来源:https://ant73.com/634.html