title: Syntax error on token "{", SwitchLabels expected after this token
body: <p>i want to open new form when i select option from spinner class </p>
  
  <p>i try this but i have syntax error </p>
  
  <blockquote>
    <p>Syntax error on token "{",
    SwitchLabels expected after this
    token</p>
  </blockquote>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.tf);
      Spinner spinner2 = (Spinner) findViewById(R.id.spinner2);
      ArrayAdapter&lt;CharSequence&gt; adapter2 = ArrayAdapter.createFromResource(
          this, R.array.tfoptions,android.R.layout.simple_spinner_item);
      adapter2.setDropDownViewResource(
          android.R.layout.simple_spinner_dropdown_item);
      spinner2.setAdapter(adapter2);
  
      spinner2.setOnItemSelectedListener(new MyOnItemSelectedListener());
  
      public class MyOnItemSelectedListener implements OnItemSelectedListener {
  
          public void onItemSelected(AdapterView&lt;?&gt; parent,
          View view, int pos, long id) {
              switch (view.isClickable()) {       &lt;---------------- syntax error 
                  Spinner spinner2;
              case spinner2.setSelection(0):
                  startActivity(new Intent(this,To.class));
                  break;
              case spinner2.setSelection(1):
                  startActivity(new Intent(this,out.class));
              default:
                  break;
              }
          }
          public void onNothingSelected(AdapterView parent) {
              // Do nothing.
          }
      }
  }
  </code></pre>