find Best Flash Mode Match - Android android.hardware

Android examples for android.hardware:Flash

Description

find Best Flash Mode Match

Demo Code

import java.util.List;

import android.hardware.Camera;

public class Main {

  public static String findBestFlashModeMatch(Camera.Parameters params, String... modes) {
    String match = null;//w  w w  . j a v a  2 s . c  o m

    List<String> flashModes = params.getSupportedFlashModes();

    if (flashModes != null) {
      for (String mode : modes) {
        if (flashModes.contains(mode)) {
          match = mode;
          break;
        }
      }
    }

    return (match);
  }

}

Related Tutorials