I am turning ON Camera LED light using FLASH_MODE_ON
.
Samsung Galaxy Ace have only three flash modes : on, off and auto.
FLASH_MODE_TORCH
not working in Samsung Galaxy Tab & Samsung Galaxy Ace 2.2.1
Here is my code how i am turning ON my Camera LED
Camera cam;
cam = Camera.open();
Parameters params = cam.getParameters();
params.setFlashMode(Parameters.FLASH_MODE_ON);
cam.setParameters(params);
cam.startPreview();
cam.autoFocus(new AutoFocusCallback() {
public void onAutoFocus(boolean success, Camera camera) {
}
});
And turning it off by using :
cam.stopPreview();
cam.release();
Code Reference : Use camera flashlight in Android
But the problem is LED Light remains on just for 5sec. It just then turns OFF automatically.
Can anyone please tell where can be the problem. OR any way to turn ON the LED light continuously till its requested to Stop.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…