I am new to android app programming and for ages my app kept crashing. I looked at the android vitals and it said this was causing the crash: java.lang.NullPointerException
.I don't know how to fix it so am I am asking for help. Thanks in advance. Here is the full crash details:
java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3623) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3775) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2261) at android.os.Handler.dispatchMessage (Handler.java:107) at android.os.Looper.loop (Looper.java:237) at android.app.ActivityThread.main (ActivityThread.java:8107) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:496) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1100)Caused by: java.lang.NullPointerException: at com.onegoodturn.viewtogiverelease.MainActivity.onCreate (MainActivity.java:58) at android.app.Activity.performCreate (Activity.java:7957) at android.app.Activity.performCreate (Activity.java:7946) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1307) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3598)