Android Question Camera 2 flash problems

Matteo Granatiero

Active Member
Licensed User
I tried browsing in the CameraEx class but I can't get it to work.
In the original camera2 project I noticed that this code is used but it turns on the flash as a flashlight (in any mode I insert it) for example "OFF", "ON", "ON_AUTO_FLASH", "ON_ALWAYS_FLASH", "ON_AUTO_FLASH_REDEYE"
and freezes.
I would like a photo style that flashes and takes the picture if activated and if disabled, simply take the picture.

Sub btnAutoExposure_Click
Dim flashes As List = cam.SupportedAutoExposureModes
Dim i As Int = flashes.IndexOf(cam.AutoExposureMode)
i = (i +
1) Mod flashes.Size
cam.AutoExposureMode = flashes.Get(i)
btnAutoExposure.Text = flashes.Get(i)
cam.StartPreview(MyTaskIndex, VideoMode)

End Sub