Implementing Custom adapter
<p>I am creating a custom adapter , simple stuff and it is exploding on public int getCount() of the adpater. I dont know what i am missing ?</p>

<pre><code>public class GREVocabulary extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        // set the color mlayout.setBackgroundColor(Color.WHATEVER);
        setContentView(R.layout.main);
        List&lt;String&gt; alphabetslsit = Arrays.asList(getResources().getStringArray(R.array.alphabet));    
        Spinner spinner = (Spinner) findViewById(R.id.spinner);
        try{
        AlphabetAdapter adapter = new AlphabetAdapter(this,alphabetslsit);


        spinner.setAdapter(adapter);
        }
        catch (Exception e)
        {
            Log.v(e.toString(),e.getMessage());
        }

    }
}

public class AlphabetAdapter extends BaseAdapter implements SpinnerAdapter
 {


    private List&lt;String&gt; aplhabetlist;
    private Context context;

    public AlphabetAdapter(Context context, List&lt;String&gt; aplhabetlist ) { 
        this.context = context;
        this.aplhabetlist = aplhabetlist;
    }

    @Override
    public int getCount() 
    {

         return aplhabetlist.size();
    }

    @Override
    public Object getItem(int arg0) {
        return aplhabetlist.get(arg0);
    }

    @Override
    public long getItemId(int arg0) {

        return arg0;
    }

    @Override
    public View getView(int arg0, View arg1, ViewGroup arg2) 
    {
        View view = super.getDropDownView(arg0, arg1, arg2);
        //if (arg0 % 2 == 0) 
        //{
        //  view.setBackgroundColor(Color.BLUE);
        //}

        return view; 

    }

}
</code></pre>

<p>following the exeception i am getting </p>

<pre><code>// Stack: 2, Locals: 2
  public bridge synthetic void setAdapter(android.widget.Adapter x0);
    0  aload_0 [this]
    1  aload_1 [x0]
    2  checkcast android.widget.SpinnerAdapter [7]
    5  invokevirtual android.widget.AbsSpinner.setAdapter(android.widget.SpinnerAdapter) : void [8]
    8  return
      Line numbers:
        [pc: 0, line: 2]
      Local variable table:
        [pc: 0, pc: 9] local: this index: 0 type: android.widget.AbsSpinner
        [pc: 0, pc: 9] local: x0 index: 1 type: android.widget.Adapter

  // Method descriptor #67 ()Landroid/widget/Adapter;
  // Stack: 1, Locals: 1
  public bridge synthetic android.widget.Adapter getAdapter();
    0  aload_0 [this]
    1  invokevirtual android.widget.AbsSpinner.getAdapter() : android.widget.SpinnerAdapter [9]
    4  areturn
      Line numbers:
        [pc: 0, line: 2]
      Local variable table:
        [pc: 0, pc: 5] local: this index: 0 type: android.widget.AbsSpinner

  Inner classes:
    [inner class info: #36 android/view/ViewGroup$LayoutParams, outer class info: #83 android/view/ViewGroup
     inner name: #37 LayoutParams, accessflags: 9 public static]
</code></pre>
