add a crashfix when debugging

This commit is contained in:
tibbi 2016-07-01 21:40:36 +02:00
parent 0520babf09
commit 9ba9f9723e
1 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,7 @@ public class MarshmallowCamera {
try { try {
final CameraManager manager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE); final CameraManager manager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
final String[] list = manager.getCameraIdList(); final String[] list = manager.getCameraIdList();
if (list.length > 0)
manager.setTorchMode(list[0], enable); manager.setTorchMode(list[0], enable);
} catch (CameraAccessException e) { } catch (CameraAccessException e) {
Log.e(TAG, "toggle marshmallow flashlight " + e.getMessage()); Log.e(TAG, "toggle marshmallow flashlight " + e.getMessage());