Code example for SpinnerAdapter

Methods: getItem

0
        return count == 0 ? 0 : count + EXTRA;
    } 
 
    @Override 
    public Object getItem(int position) {
        return position == 0 ? null : adapter.getItem(position - EXTRA);
    } 
 
    @Override 
    public int getItemViewType(int position) {
        // Doesn't work!! Vote to Fix! http://code.google.com/p/android/issues/detail?id=17128 - 
        // Spinner does not support multiple view types 
        // This method determines what is the convertView, this should 
        // return 1 for pos 0 or return 0 otherwise. 
        return position == 0 ?
               getViewTypeCount() - EXTRA :
               adapter.getItemViewType(position - EXTRA);
    } 
 
    @Override 
Experience pair programming with AI  Get Codota for Java