title: Why doesn't a button change the layout?
body: <p>I would like to press a button and for a new layout to appear.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>My class names are: StarWars.java and Test1.java
  Layout names: activity_star_wars-.xml and test1.xml</p>
  
  <p>My code:</p>
  
  <pre><code>package de.starwars;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_star_wars);
  
  Button jm = (Button) findViewById(R.id.btxJediMaster);
  jm.setOnClickListener(new View.OnClickListener()
  {
  
  @Override
  public void onClick(View v)
  {
      // TODO Auto-generated method stub
      Intent i = new Intent (StarWars.this,Test1.class);
          startActivity(i);       
  }
  });
  
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.activity_star_wars, menu);
      return true;
  }  
  }
  </code></pre>
  
  <p>The manifest:</p>
  
  <pre><code>&lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="18" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="de.starwars.MainActivity"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>