Android examples for java.lang:array
Generic method to select Value from array
import android.widget.AdapterView; public class Main{ public static <T> T selectedValue(T[] values, long index) { T result = null;// w w w. j a va2s .c o m if (index != AdapterView.INVALID_ROW_ID) { result = values[(int) index]; } return result; } public static Integer selectedValue(int[] values, long index) { Integer result = null; if (index != AdapterView.INVALID_ROW_ID) { result = values[(int) index]; } return result; } }