0

I am using android's Flash Light to turn on the flashlight from within my app, its working fine for 1.Sony Xperia 2.Galaxy Tab 10 inches But, accidentally the same code is not working for Samsung Galaxy Tab 7 inches.

The method i have written is :

 private void toggleFlashlight() {
    Parameters p = mCamera.getParameters();
    if (!mToogleFlashlight) {
        mToogleFlashlight = true;
        p.setFlashMode(Parameters.FLASH_MODE_TORCH);
    } else {
        mToogleFlashlight = false;
        p.setFlashMode(Parameters.FLASH_MODE_OFF);
    }
    if (mCamera != null) {
        mCamera.setParameters(p);
    }
 }

Along with this I have also included the permissions and feature list I had to, in the AndroidManifest.xml

Only if there was some problem in the Manifest(either some tag was missing) it wouldnt work for the other devices as well. I mean I can not track this what kind of mind boggling issue this is. Please help me with some fix, have deadlines to meet and already screwed in this issue.

A--C
  • 36,351
  • 10
  • 106
  • 92
Varun
  • 87
  • 1
  • 10

1 Answers1

0

I think this solves your problem.
Maybe you should also test the behavior with this app. It has an debug screen pressing the "Volume down"-button (originally posted here).

Community
  • 1
  • 1