The app does not run on the emulator. Please check the logcat

Asked 2 years ago, Updated 2 years ago, 95 views

2019-05-19 20:55:58.007 16031-16031/com.example.restaurant_app E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.restaurant_app, PID: 16031 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.restaurant_app/com.example.restaurant_app.RestaurantDetailActivity}: android.view.InflateException: Binary XML file line #7: Binary XML file line #7: Error inflating class fragment at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: android.view.InflateException: Binary XML file line #7: Binary XML file line #7: Error inflating class fragment Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class fragment Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.widget.ListView.findViewById(int)' on a null object reference at com.example.restaurant_app.RestaurantMenuFragment.onCreateView(RestaurantMenuFragment.java:59) at android.support.v4.app.Fragment.performCreateView(Fragment.java:2439) at android.support.v4.app.FragmentManagerImpl.ensureInflatedFragmentView(FragmentManager.java:1689) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1431) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1684) at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1930) at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:3745) at android.support.v4.app.FragmentController.onCreateView(FragmentController.java:120) at android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:405) at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:387) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:780) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) at android.view.LayoutInflater.rInflate(LayoutInflater.java:863) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.example.restaurant_app.RestaurantDetailActivity.onCreate(RestaurantDetailActivity.java:14) at android.app.Activity.performCreate(Activity.java:7136) at android.app.Activity.performCreate(Activity.java:7127) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) at android.os.Handler.dispatchMessage(Handler.java:106) 2019-05-19 20:55:58.007 16031-16031/com.example.restaurant_app E/AndroidRuntime: at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

android fragment

2022-09-22 12:33

1 Answers

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.