Camera.open()返回null [英] Camera.open() returns null

查看:595
本文介绍了Camera.open()返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我称之为 mCamera = Camera.open()返回空值,这可能是造成这?我的设备是的Nexus 7。

我已经有中设置的权限我的的Andr​​oidManifest.xml

 <使用-权限的Andr​​oid:名称=android.permission.CAMERA/>
 

解决方案

想通了,

您需要调用 Camera.open(0)

这是唯一有效的和工作的NEXUS 7的设备,因为它只有一个摄像头,所以如果只针对该设备才有用。

When I call mCamera = Camera.open() it returns null, what could be causing this? My device is the Nexus 7.

I already have the permissions set in my AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />

解决方案

Figured it out,

You need to call Camera.open(0).

THIS IS ONLY VALID AND WORKING ON THE NEXUS 7 device, as it only has one camera, so is only useful if targeting that device only.

这篇关于Camera.open()返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆