Code example for ListAdapter

Methods: getCountgetItem

0
    } 
 
    private LocaleInfo getCheckedLocale() { 
        int pos = mListView.getCheckedItemPosition();
        ListAdapter a = mListView.getAdapter();
        int n = a.getCount();
        if (pos >= 0 && pos < n) {
            Object o = a.getItem(pos);
            if (o instanceof LocaleInfo) {
                return (LocaleInfo) o;
            } 
        } 
 
        return null; 
    } 
 
    /** Update the Select/Remove buttons based on the currently checked locale. */ 
    private void updateLocaleButtons() { 
        LocaleInfo info = getCheckedLocale();
        if (info != null) {
            // Enable it