title: How to programmatically turn torch-flash light on
body: <p>I am using LG Optimus 3D model, I am able to turn on the torch light when I switch the camera to video recording mode. In normal capture mode, I am only able to turn on flash light.</p>
  
  <p>I have tried several way by adding different parameters into the Camera object, but none of them work. My code is as below:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_flash_light);
  
  
  
      PackageManager pm = getPackageManager();
  
      if (! pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH)){
          Toast.makeText(this, "Your phone does not have flash light support.", Toast.LENGTH_LONG).show();
          finish();
      }
  
      camera = Camera.open(); 
      cParameters = camera.getParameters();
  
  
  
      cParameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
  camera.setParameters(cParameters);
  
  }
  </code></pre>
  
  <p>No point I cannot turn it on programmatically, I have checked as below to ensure my phone support torch mode, in fact, I am really able to turn on for my device.</p>
  
  <pre><code>List&lt;String&gt; abc = cParameters.getSupportedFlashModes();
  
          for (String a : abc){
              Log.d("mode: ", a);
  }
  </code></pre>
  
  <p>Please help, anyway to do that?
  * The firmware is 2.2</p>