Android examples for User Interface:AdapterView
Get selected Value from AdapterView
//package com.java2s; import android.widget.AdapterView; public class Main { public static <T> T selectedValue(T[] values, long index) { T result = null;/*from www .j a v a 2 s . co 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; } }