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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 自由程序员2006

股市赚钱就是这么简单 四角号码查询器手机版 解决 HttpWebResponse.GetResponse()一直提示超时 解决Oracle登录极慢的问题 分享 百度网盘,不用开会员也可以免费同步上传视频和照片的方法 广电的宽带网络真流氓,替换google的广告为百度的广告 - 自由程序员2006 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