title: unfortunately application has stopped in android emulator-error ,How to solve this? Below are the logcat messages
body: <pre><code>01-19 12:38:42.505: D/AndroidRuntime(14027): Shutting down VM
  01-19 12:38:42.505: W/dalvikvm(14027): threadid=1: thread exiting with uncaught exception (group=0x40c21a68)
  01-19 12:38:42.525: E/AndroidRuntime(14027): FATAL EXCEPTION: main
  01-19 12:38:42.525: E/AndroidRuntime(14027): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.learnactivities/com.example.learnactivities.Main}: java.lang.NullPointerException
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at android.app.ActivityThread.access$600(ActivityThread.java:128)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at android.os.Handler.dispatchMessage(Handler.java:99)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at android.os.Looper.loop(Looper.java:137)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at android.app.ActivityThread.main(ActivityThread.java:4517)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at java.lang.reflect.Method.invokeNative(Native Method)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at java.lang.reflect.Method.invoke(Method.java:511)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at dalvik.system.NativeStart.main(Native Method)
  01-19 12:38:42.525: E/AndroidRuntime(14027): Caused by: java.lang.NullPointerException
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at com.example.learnactivities.Main.onCreate(Main.java:17)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at android.app.Activity.performCreate(Activity.java:4470)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
  01-19 12:38:42.525: E/AndroidRuntime(14027):    ... 11 more
  01-19 12:38:50.635: I/Process(14027): Sending signal. PID: 14027 SIG: 9
  </code></pre>
  
  <p>Code </p>
  
  <pre><code>package com.example.learnactivities;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  public class Main extends Activity {
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Button b = (Button) findViewById(R.id.action_settings);
          b.setOnClickListener(new OnClickListener() {
              public void onClick(View arg0) {
                  startActivity(new Intent(Main.this, Second.class));
              }
          });
      }
  }
  </code></pre>
  
  <p>xml layout</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="schemas.android.com/apk/res/android"
      xmlns:tools="schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".Main" &gt;
  
      &lt;Button
          android:id="@+id/button1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="188dp"
          android:text="Button" /&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>