title: Android log cat error
body: <p>The logcat message shows this:</p>
  
  <pre><code>12-05 19:24:09.406 28495-28495/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                     Process: com.example.user.fragment, PID: 28495
                                                     java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.fragment/com.example.user.fragment.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)
                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
                                                         at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                         at android.os.Looper.loop(Looper.java:154)
                                                         at android.app.ActivityThread.main(ActivityThread.java:6123)
                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
                                                      Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                                                         at com.example.user.fragment.MainActivity.onCreate(MainActivity.java:25)
                                                         at android.app.Activity.performCreate(Activity.java:6672)
                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612)
                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724) 
                                                         at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473) 
                                                         at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                         at android.os.Looper.loop(Looper.java:154) 
                                                         at android.app.ActivityThread.main(ActivityThread.java:6123) 
                                                         at java.lang.reflect.Method.invoke(Native Method) 
                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) 
                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757) 
  </code></pre>
  
  <p>The app has suddenly stopped working. What could be the possible error?</p>