search list of Camera size for Size - Android Phone

Android examples for Phone:Camera

Description

search list of Camera size for Size

Demo Code


//package com.java2s;

import java.util.Iterator;
import java.util.List;
import android.hardware.Camera.Size;

public class Main {
    public static boolean containsSize(List<Size> sizes, Size size) {
        for (Iterator<Size> iterator = sizes.iterator(); iterator.hasNext();) {
            Size currSize = iterator.next();
            if (currSize.width == size.width
                    && currSize.height == size.height) {
                return true;
            }//from w w  w.  j a  va2  s. c om
        }
        return false;
    }
}

Related Tutorials