Code example for Spinner

Methods: getSelectedItemPosition

0
    void setSelected(int position) {
        mView.setSelection(position);
    } 
 
    int getSelected() { 
        return mView.getSelectedItemPosition();
    } 
 
    int getCount() { 
        return mView.getCount();
    } 
 
    private void refreshSelectedItem() { 
        View selected = mView.getSelectedView();
        if (selected == null) {
            return; 
        } 
        selected.setActivated(mExpanded);
    } 
 
    private void createView(ViewGroup parent, TypedArray attributes) {