Hi i have made a simple food ordering app , but When I start it , it crashes and the error thrown in Logcat is this.Please Help Me out...
05-18 17:26:41.104 18166-18166/com.example.sample E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.sample, PID: 18166 java.lang.RuntimeException: Unable to start activity > ComponentInfo{com.example.sample/com.example.sample.MainActivity}: java.lang.NullPointerException: > Attempt to invoke virtual method 'void androidx.appcompat.app.ActionBar.hide()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2487) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2547) at android.app.ActivityThread.access$1100(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5603) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void > > > androidx.appcompat.app.ActionBar.hide()' on a null object reference at com.example.sample.MainActivity.onCreate(MainActivity.java:39) at android.app.Activity.performCreate(Activity.java:6355) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2440) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2547) at android.app.ActivityThread.access$1100(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5603) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)Entire code - Github.
Hope You Have All Required Files , ask me if not there. Please Help!!!!