Code example for Spinner

Methods: getSelectedItem

0
		mGroupSpinner.setAdapter(mGroupAdapter);
		mGroupSpinner.setOnItemSelectedListener(this);
	} 
 
	public String getGroupName() {
		String spinnerItem = mGroupSpinner.getSelectedItem().toString();
		if (spinnerItem.equals(mDefaultGroup)) {
			// return internal representation 
			return ""; 
		} else if (spinnerItem.equals(mAddGroupString)) {
			return mNewGroupInput.getText().toString();
		} else { 
			return spinnerItem;
		} 
	} 
 
	void setInputVisibility(boolean vis) {
		Log.d("GroupNameView", "setInputVisibility: " + vis);
		mNewGroupInput.setVisibility(vis ? View.VISIBLE : View.GONE);
		mNewGroupInput.setEnabled(vis);
	}