Android camera2 判断相机功能是否可控的实例

2025-02-26 09:58:59
推荐回答(1个)
回答1:

转: 看官方API发现的一行,记录下来 ... 文档说调用相机功能要增加这行到配置文件里,表明用到相机功能。(貌似根据网上例子没加这个也能打开默认相机功能。) It's then your responsibility to check for the availabilityof the camera at runtime by callinghasSystemFeature(PackageManager.FEATURE_CAMERA).If a camera is not available, you should then disable your camera features. 要通过这个来检查设备是否有照相机功能,没有的话就要根据情况调整,或者是关闭相机功能,避免出错。