Android examples for java.lang:array contain
check if array Contains a specific Value
//package com.java2s; public class Main { public static boolean arrayContainsValue(Object[] array, Object value) { return findValueInArray(array, value) != -1; }//w ww. j a v a 2s . co m public static int findValueInArray(Object[] array, Object value) { for (int i = 0; i < array.length; i++) { if (array[i].equals(value)) return i; } return -1; } }