title: changing layout and activity in spinner
body: <p>First of all, I am fairly new at this, so bear with me.
  I am trying to make a spinner where if you select an item, the layout and the activity will change, but I cant even implement the simplest of spinners.</p>
  
  <p>so far the only code I've got is the one below, but no matter what I put in it doesn't do anything, so I must just not understand it, please be very specific in your answers. thank you. the first answer got me some of the way, but the "spinner spin..... spin.setAdapter(aa)" part is not accepted under OnCreate</p>
  
  <pre><code>String[] generations = { "Gen2", "Gen3", "Gen4", "Gen5", "Gen6","Gen7"  };
  
  Spinner spin = (Spinner) findViewById(R.id.spinner1);  
  spin.setOnItemSelectedListener(this);  
  ArrayAdapter aa = new ArrayAdapter(this,android.R.layout.simple_spinner_item,generations);  
  aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);  
  //Setting the ArrayAdapter data on the Spinner  
  spin.setAdapter(aa);
  
  public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
      switch (position) {
          case 1:
              Intent intent2 = new Intent(this, gen2.class);
              startActivity(intent2);
              break;
          case 2:
              Intent intent3 = new Intent(this, Gen3.class);
              startActivity(intent3);
              break;
          case 3:
              Intent intent4 = new Intent(this, gen4.class);
              startActivity(intent4);
              break;
          case 4:
              Intent intent5 = new Intent(this, gen5.class);
              startActivity(intent5);
              break;
          case 5:
              Intent intent6 = new Intent(this, MainActivity.class);
              startActivity(intent6);
              break;
          case 6:
              Intent intent7 = new Intent(this, gen7.class);
              startActivity(intent7);
              break;
      }
  }
  </code></pre>