java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.design.widget.NavigationView.setNavigationItemSelectedListener(android.support.design.widget.NavigationView$OnNavigationItemSelectedListener)' on a null object reference


Solutions on the web135

Solution icon of stackoverflow
Attempt to invoke virtual method 'void android.support.design.widget.NavigationView.setNavigationItemSelectedListener(android.support.design.widget.NavigationView$OnNavigationItemSelectedListener)' on a null object reference

Solution icon of stackoverflow
Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference

Solution icon of stackoverflow
via Stack Overflow by Marky
, 1 week ago
Attempt to invoke virtual method 'void me.wangyuwei.loadingview.LoadingView.start()' on a null object reference

Solution icon of github
Attempt to invoke virtual method 'void com.afollestad.materialdialogs.internal.MDButton.setVisibility(int)' on a null object reference

Solution icon of stackoverflow
Attempt to invoke virtual method 'void android.widget.GridView.setAdapter(android.widget.ListAdapter)' on a null object reference

Solution icon of github
Attempt to invoke virtual method 'void android.view.View.setBackgroundResource(int)' on a null object reference

Solution icon of stackoverflow
via Stack Overflow by Matt Brown
, 1 year ago
Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference

Solution icon of stackoverflow
Attempt to invoke virtual method 'void android.widget.TextView.setText(int)' on a null object reference

Solution icon of stackoverflow
Attempt to invoke virtual method 'void android.support.v4.widget.DrawerLayout.addDrawerListener(android.support.v4.widget.DrawerLayout$DrawerListener)' on a null object reference

Solution icon of stackoverflow
Attempt to invoke virtual method 'void android.widget.RatingBar.setOnRatingBarChangeListener(android.widget.RatingBar$OnRatingBarChangeListener)' on a null object reference

Stack trace

java.lang.NullPointerException: Attempt to invoke virtual method 'void
    android.support.design.widget.NavigationView.setNavigationItemSelectedListener(android.support.design.widget.NavigationView$OnNavigationItemSelectedListener)'
    on a null object reference
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 9 months ago
2 times, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 10 months ago
5 times, 10 months ago
9 times, 1 year ago
5 more bugmates