title: How to turn on FlashLight in Lollipop programmatically Android
body: <pre><code>Camera cam = Camera.open();     
  Parameters p = cam.getParameters();
  p.setFlashMode(Parameters.FLASH_MODE_TORCH);
  cam.setParameters(p);
  cam.startPreview();
  </code></pre>
  
  <p>The above dose not work on Lollipop, Because Camera is deprecated in Lollipop. I cant able to find any other way to turn on flash programmatically in Lollipop. How  can I achieve this. Thanks in advance. </p>