【发布时间】:2012-08-16 17:58:40
【问题描述】:
当我调用 mCamera = Camera.open() 时它返回 null,这可能是什么原因造成的?我的设备是 Nexus 7。
我已经在我的AndroidManifest.xml 中设置了权限:
<uses-permission android:name="android.permission.CAMERA" />
【问题讨论】:
-
试试this
-
同样,
camera = Camera.open();返回 null。 -
是的...不过我有点傻... API 显示为
Creates a new Camera object to access the first back-facing camera on the device. If the device does not have a back-facing camera, this returns null....Nexus 7 没有后置摄像头,只有前置摄像头。 -
是的。之前,看到设备我不知道这一点。只知道我通过the document 知道这一点尝试打开辅助摄像头。而且,只要试试this