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

推荐订阅源

小众软件
小众软件
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Troy Hunt's Blog
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
WordPress大学
WordPress大学
Recent Commits to openclaw:main
Recent Commits to openclaw:main
W
WeLiveSecurity
GbyAI
GbyAI
V2EX - 技术
V2EX - 技术
Latest news
Latest news
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
K
Kaspersky official blog
PCI Perspectives
PCI Perspectives
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 叶小钗
I
InfoQ
Y
Y Combinator Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
The Register - Security
The Register - Security
U
Unit 42
F
Full Disclosure
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
D
DataBreaches.Net
博客园 - 聂微东
Recorded Future
Recorded Future
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
S
Secure Thoughts
博客园 - Franky
M
MIT News - Artificial intelligence
爱范儿
爱范儿
N
Netflix TechBlog - Medium
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
SegmentFault 最新的问题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threat Research - Cisco Blogs
腾讯CDC
S
Securelist
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
Google Online Security Blog
Google Online Security Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Cybersecurity and Infrastructure Security Agency CISA
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 自由程序员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