title: How to set onClickListener() for view of Spinner?
body: <p>I want to catch user interaction with a spinner like onCLickListener. Do to the 'don't call onClickListener() on AdapterView' error I found recommendations that you should override a constructer with a custom spinner to set onClickListener() on the view the spinner creates.</p>
  
  <p>Tried that:</p>
  
  <pre><code>public class MySpinner extends Spinner {
  
  public static final String TAG = "MyApp";
  
  public MySpinner(Context context, AttributeSet attrs) {
      super(context, attrs);
      ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(context, R.array.temp_systems, android.R.layout.simple_spinner_item);
      TextView spinner_text = (TextView) findViewById(android.R.id.text1);
      OnClickListener spinnerOnClickListener = new OnClickListener() {
  
          public void onClick(View v) {
              Log.d(TAG, "Should do something!");
          }
  
      };
  
      spinner_text.setOnClickListener(spinnerOnClickListener);
  
      setAdapter(adapter);
  }
  
  }
  </code></pre>
  
  <p>but when I try to include this in a layout I get a crash on failing to inflate this item.</p>
  
  <p>To clarify here, onItemClickListener fires when the user clicks an item in the dropdown menu, not when the spinner is collapsed. I need to intercept after the initial spinner is clicked but before it creates the dropdown menu.</p>