title: Creating a setError() for the Spinner
body: <p>How do you create the <code>setError()</code> (similar to that of a <code>TextView/EditText</code>) function for a <code>Spinner</code>? The following doesn't work:</p>
  
  <p>I tried extending the Spinner class and in the constructor:</p>
  
  <pre><code>ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(getContext(),
                      android.R.layout.simple_spinner_item, android.R.id.text1,
                      items);
              aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
              setAdapter(aa);
               tv = (TextView) findViewById(android.R.id.text1);
              // types_layout_list_tv
  
              ctv = (CheckedTextView) aa.getDropDownView(1, null, null);
              tv2 = (TextView) aa.getView(1, null, null);
  </code></pre>
  
  <p><code>setError</code> method:</p>
  
  <pre><code>    public void setError(String str) {
          if (tv != null)
              tv.setError(str);
          if(tv2!=null)
              tv2.setError(str);
          if (ctv != null)
              ctv.setError(str);
      }
  </code></pre>