Android 5,camera2 只使用闪光灯

2022-01-08 00:00:00 camera java android-5.0-lollipop

我只需要使用带有 API camera2(Android 5,API 级别 21)的闪光灯,例如手电筒应用程序.但是我发现的所有示例都需要在视图中显示相机流

I need to use only the flash with the API camera2 (Android 5, API level 21), like torch applications. But all the examples that I found requires the display of camera stream in a view

推荐答案

https://github.com/pinguo-yuyidong/Camera2/blob/master/app/src/main/java/us/yydcdut/androidltest/otheractivity/FlashActivity.java
在这里,打开flash不需要预览.

https://github.com/pinguo-yuyidong/Camera2/blob/master/app/src/main/java/us/yydcdut/androidltest/otheractivity/FlashActivity.java
here,you don't need the preview to open the flash.

相关文章