Bottomnavigationview Is Null
I have a runtime exception when implementing BottomNavigationView, Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.material.bo
Solution 1:
You are trying to find the BottomNavigationView before setting the activity view. You should set content view first.
Reorganize your code as follow
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// everything other
}
Post a Comment for "Bottomnavigationview Is Null"