Android examples for java.lang:array
Generic method to get index Of an element inside an array
import java.lang.reflect.Array; import java.util.List; public class Main{ public static <T> int indexOf(T[] array, T object) { for (int i = 0; i < array.length; i++) { if (object.equals(array[i])) { return i; }//from w w w . j a va2s . com } return -1; } }