java.lang.RuntimeException: Unable to start activity ComponentInfo{com.horizonservers.horizon/com.horizonservers.horizon.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.design.widget.NavigationView.addHeaderView(android.view.View)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java)

Stack Overflow | Destry | 6 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    How to programmatically change the Text and Image of the Navigation Header for android

    Stack Overflow | 6 months ago | Destry
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.horizonservers.horizon/com.horizonservers.horizon.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.design.widget.NavigationView.addHeaderView(android.view.View)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java)

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void' android.support.design.widget.NavigationView.addHeaderView(android.view.View)' on a null object reference

      at com.horizonservers.horizon.MainFragment.onCreateView()
    2. com.horizonservers.horizon
      MainFragment.onCreateView
      1. com.horizonservers.horizon.MainFragment.onCreateView(MainFragment.java:153)
      1 frame
    3. Android Support v4
      FragmentActivity.onStart
      1. android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)
      2. android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
      3. android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
      4. android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
      5. android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
      6. android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:339)
      7. android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:601)
      7 frames
    4. Android Platform
      ActivityThread.performLaunchActivity
      1. android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237)
      2. android.app.Activity.performStart(Activity.java:6253)
      3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
      3 frames