title: Set spinner selected item text
body: <p>I have a spinner (only relevant parts of code)...</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
  
     Spinner to_spinner = (Spinner) findViewById(R.id.to_spinner);
     List&lt;Unit&gt; list = myDbHelper.getAllUnits();
     SpinnerUnitAdapter tUnitAdapter tUnitAdapter = new SpinnerUnitAdapter(this, android.R.layout.simple_spinner_item, list);
  
     to_spinner.setAdapter(tUnitAdapter);
     to_spinner.setOnItemSelectedListener(onItemSelectedListenerTo);
  }
  </code></pre>
  
  <p>with an onItemSelectedListener</p>
  
  <pre><code>AdapterView.OnItemSelectedListener onItemSelectedListenerTo = new     AdapterView.OnItemSelectedListener() {
  
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; adapterView, View view,
                                 int position, long id) {
  
          // do stuff
      }
  
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; adapter) {
      }
  };
  </code></pre>
  
  <p>When an item is selected (i.e. where it says: "do stuff"), I would like to set/change the text of the selected spinner item. (Note that this is <em>not the same</em> as setting the spinner position (with setSelection()).</p>
  
  <p>I was thinking of doing this with</p>
  
  <pre><code>tUnitAdapter.getView(position, ?, ?).setText("new text");
  </code></pre>
  
  <p>Am I on the right track? What to put as second ("convertView") and third ("parent") argument in getView. My spinner adapter looks like:</p>
  
  <pre><code>public class SpinnerUnitAdapter extends ArrayAdapter&lt;Unit&gt; {
       ...
       @Override
       public View getView(int position, View convertView, ViewGroup parent) {
           TextView label = new TextView(mContext);
           label.setTextColor(Color.BLACK);                        
         label.setTextSize(mContext.getResources().getDimension(R.dimen.list_row_font_size));
           label.setGravity(Gravity.CENTER);
           label.setText(getItem(position).getName());
  
           return label;
      }
  }
  </code></pre>