0

I'm using the following code but the flashlight would just on for less then a second when i press the button.

I'm Using Motorola XT907

Camera  cam;
cam = Camera.open();
Camera.Parameters p = cam.getParameters();
p.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
cam.setParameters(p);
cam.startPreview();
Mahesh Babariya
  • 4,560
  • 6
  • 39
  • 54
Ahmed
  • 89
  • 10

1 Answers1

0

SOLVED

Somehow using the SurfaceView and SurfaceHolder class solved the problem for me

Code is described in the following thread.

LED flashlight on Galaxy Nexus controllable by what API?

Ahmed
  • 89
  • 10