title: Spinner getSelectedView() is null
body: <p>I got a spinner it has 6 items in it, I can see them.when I call spinner.getSelectedView(), it is always null</p>
  
  <p>Any idea why?</p>
  
  <pre><code>sortSpinner.setSelection(2);
  CheckedTextView v = (CheckedTextView) sortSpinner.getSelectedView(); //crash null pointer
  v.setChecked(true);
  </code></pre>
  
  <p>Edit:</p>
  
  <p>I am extending ArrayAdapter for the spinner's adapter</p>
  
  <pre><code>public class CustomSpinnerAdapter extends ArrayAdapter&lt;String&gt; {
      private Context context;
      private int layoutResourceId;
      private ArrayList&lt;String&gt; objects;
  
      public CustomSpinnerAdapter(Context ctx, int layoutResourceId,
              ArrayList&lt;String&gt; placeTypes) {
          super(ctx, layoutResourceId, placeTypes);
          this.context = ctx;
          this.layoutResourceId = layoutResourceId;
          this.objects =placeTypes;
      }
  
      @Override
      public View getDropDownView(int position, View cnvtView, ViewGroup prnt) {
          return getCustomView(position, cnvtView, prnt);
      }
  
      @Override
      public View getView(int pos, View cnvtView, ViewGroup prnt) {
          return getCustomView(pos, cnvtView, prnt);
      }
  
      class ViewHolderItem {
          TextView title;
      }
  
      public View getCustomView(int position, View convertView, ViewGroup parent) {
          ViewHolderItem viewHolder;
  
          if (convertView == null) {
  
              // inflate the layout
              LayoutInflater inflater = ((Activity) context).getLayoutInflater();
              convertView = inflater.inflate(layoutResourceId, parent, false);
              viewHolder = new ViewHolderItem();
              viewHolder.title = (TextView) convertView.findViewById(R.id.title);
              //Utils.setFontRobotLight(context, viewHolder.title);
              convertView.setTag(viewHolder);
          } else {
              viewHolder = (ViewHolderItem) convertView.getTag();
          }
          String str = objects.get(position);
          viewHolder.title.setText(str);
  
          return convertView;
      }
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code> ArrayList&lt;String&gt; sortList = new ArrayList&lt;String&gt;(Arrays.asList(sortArr));
   CustomSpinnerAdapter sortAdapter = new CustomSpinnerAdapter(this, R.layout.custom_spinner_adapter_view_red,
                      sortList);
   sortSpinner.setAdapter(sortAdapter);
  </code></pre>
  
  <p>Error from stack trace:</p>
  
  <blockquote>
    <p>java.lang.RuntimeException: Unable to start activity
    ComponentInfo{my.activity.name}: java.lang.NullPointerException:
    Attempt to invoke virtual method 'void
    android.widget.CheckedTextView.setChecked(boolean)' on a null object
    reference</p>
  </blockquote>
  
  <pre><code>java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.CheckedTextView.setChecked(boolean)' on a null object reference
  my.package.name.setSort(MyActivity.java:555)
  my.package.name.onCreate(MyActivity.java:413)
  android.app.Activity.performCreate(Activity.java:5990)
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2309)
  </code></pre>
  
  <p>Line 55 is v.setChecked(true)</p>