title: How to handle an onClickListener for a Button within the Spinner onItemSelected(...) method?
body: <p>I have a <code>Spinner.onItemSelected()</code> method and I want to be able to have an event happen once a <code>Button</code> is clicked after selecting the <code>Spinner</code> item.</p>
  
  <p>For example if you select Beginner for your Spinner and click Java for another spinner. Under that I have a button that says Start. How do I have a <code>Button.onClick</code> event correspond with the selected spinner options?</p>
  
  <p>I did something like this but what I assigned as the <code>setOnClickListener()</code> value is not being read by the <code>View.OnClickListener</code>.</p>
  
  <pre><code>   public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
          long arg3) {
      // TODO Auto-generated method stub
      selected = (Integer) arg0.getItemAtPosition(0);
      position = spinner.getSelectedItemPosition();
      start = (Button)findViewById(R.id.start);
      start.setOnClickListener(phaseHandler);
  
      View.OnClickListener phaseHandler = new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
  
          }
      };
  
  
  }
  </code></pre>
  
  <p>The <code>phaseHandler</code> I declared is not being read by <code>start.setOnClickListener(phaseHandler)</code> so this results in my <code>View.OnCLickListenr</code> invocation not working because <code>phaseHandler</code> is not being set to the <code>Button</code> start. In Eclipse my <code>phaseHandler</code> has the red underlining curly for an error where it says <code>start.setOnClickListener(phaseHandler);</code></p>
  
  <p>Any Ideas?</p>