android - Camera2问题
伊谢尔伦
伊谢尔伦 2017-04-18 09:07:57
0
1
456

在6.0.1系统做定制相机开发,调用系统API CameraManager.getCameraList()。获取的cameraId数组为空。事实上设备是有一个摄像头的。为什么会拿不到?请教下是什么原因?有没有其他手段避开这个问题顺利完成相机定制?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
Ty80

Without obtaining camera permission, the real phone displays two values ​​0 (Non-removable cameras use integers starting at 0 for their identifiers) and 1 (both front and rear cameras);
Official document What is shown above is CameraManager.getCameraIdList(), not CameraManager.getCameraList(). CameraManager.getCameraIdList(),而不是CameraManager.getCameraList(),
这个 API 是 Android 21 添加的,检查下 targetSdkVersionThis API was added in Android 21. Check whether targetSdkVersion is lower than 21.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template