title: Why does my apps stop working when I click a button to call second activity?
body: <p>I have a simple apps where on the main tab, I have a button. On clicking the button it is suppose launch another tab. However when I click the button, the screen goes blank and it says:</p>
  
  <blockquote>
    <p>Unfortunately appname has stopped</p>
  </blockquote>
  
  <p>Where did I go wrong?</p>
  
  <p>Code snippets include:</p>
  
  <ol>
  <li><p>MainActivity.Java</p>
  
  <pre><code>   public class MainActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
  }
  
  public void serveMenu(View view) {
    // Do something in response to button
  Intent intent = new Intent(this, ServeMenuActivity.class);
  startActivity(intent);
  
    }
      }
  </code></pre></li>
  <li><p>ServeMenuActivity.Java</p>
  
  <pre><code> import android.app.Activity;
   import android.content.Intent;
   import android.os.Bundle;
   import android.view.Menu;
  
     public class ServeMenuActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_serve_menu);
  Intent intent = getIntent();
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
  // Inflate the menu; this adds items to the action bar if it is present.
  getMenuInflater().inflate(R.menu.serve_menu, menu);
  return true;
   }
  
     }
  </code></pre></li>
  <li><p>AdriodManifest.xml</p>
  
  <p></p>
  
  <p></p>
  
  <p>
      
          
              </p>
  
  <pre><code>        &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
      &lt;/intent-filter&gt;
  &lt;/activity&gt;
  &lt;activity
      android:name="com.mywinsystems.tkrctennistips.ServeMenuActivity"
      android:label="@string/title_activity_serve_menu" &gt;
  
  &lt;/activity&gt;
  </code></pre>
  
  <p></p>
  
  <p></p></li>
  </ol>