Spinner Switch Case Problem
<p>EDIT: i have added in all of my code (excluding package and imports.....) and if i try to run it it crashes...... any ideas why?</p>

<pre><code>public class BaseConverter extends Activity {
/** Called when the activity is first created. */
int inputBase;
int outputBase;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Spinner input_spinner = (Spinner) findViewById(R.id.InputSpinner);
    Spinner output_spinner = (Spinner) findViewById(R.id.OutputSpinner);

    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(
            this, R.array.base_numbers_array, android.R.layout.simple_spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    input_spinner.setAdapter(adapter);
    output_spinner.setAdapter(adapter);

    input_spinner.setOnItemSelectedListener(new InputItemSelectedListener());

    output_spinner.setOnItemSelectedListener(new OutputItemSelectedListener());
}

public class InputItemSelectedListener implements OnItemSelectedListener {

    public void onItemSelected(AdapterView&lt;?&gt; parent,
        View view, int pos, long id)
        {
        /*  switch (Integer.parseInt(parent.getItemAtPosition(pos).toString())
            case ((Integer)parent.getItemAtPosition(pos)).intValue(); 
                inputBase = 2;
                break;
            case 8:
                inputBase = 8;
                break;
            case 10;
                inputBase = 10;
                break;
            case 16;
                inputBase = 16;
                break;
                */

        Toast.makeText(parent.getContext(), "You selected input base " +
                parent.getItemAtPosition(pos).toString(), Toast.LENGTH_SHORT).show();
        }

    public void onNothingSelected(AdapterView parent) 
    {
      // Do nothing.
    }
}

public class OutputItemSelectedListener implements OnItemSelectedListener {

    public void onItemSelected(AdapterView&lt;?&gt; parent,
        View view, int pos, long id) { 
      Toast.makeText(parent.getContext(), "You selected output base " +
          parent.getItemAtPosition(pos).toString(), Toast.LENGTH_SHORT).show();
    }

    public void onNothingSelected(AdapterView parent) {
      // Do nothing.
    }
} 
</code></pre>

<p>}</p>

<p>and now need to have a switch - case scenario that all revolves around what the value they selected it. they are all numbers (the choices) and are stored in an Integer array. How do i set up that switch-case correctly? i tried doing a simple thing like</p>

<pre><code> case ((Integer.parseInt(parent.getItemAtPosition(pos).toString())
</code></pre>
