Hey,
i tried to make an app, than can switch my camera flash on and off.
The code i have atm looks like this:
and in the manifest xml:
Everytime i run the code, the app crashes.
What is wrong?
i tried to make an app, than can switch my camera flash on and off.
The code i have atm looks like this:
PHP:
Camera flash;
Camera.Parameters params;
flash = Camera.open();
params = flash.getParameters();
params.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
flash.setParameters(params);
and in the manifest xml:
PHP:
<permission android:name="android.permission.FLASHLIGHT"
android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
android:protectionLevel="normal" />
<permission android:name="android.permission.CAMERA"></permission>
Everytime i run the code, the app crashes.
What is wrong?