Good afternoon, I'm using the BottomNavigationViewEx lib to make a navigation bar for an Android application, but when I use the methods "enableXXXX"
and "setTextVisibility"
it gives the error below. Does anyone know why and how to solve it? Thank you.
PS: "setOnNavigationItemSelectedListener"
works.
Error:
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.getBottomNavigationItemViews(BottomNavigationViewEx.java:569) at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.enableAnimation(BottomNavigationViewEx.java:341) at io.github.bfaguiar.ianthe.HomeActivity.onCreate(HomeActivity.java:64) '
Code:
BottomNavigationViewEx bnav = (BottomNavigationViewEx) findViewById(R.id.bnve);
bnav.enableAnimation(false);
bnav.enableItemShiftingMode(false);
bnav.enableShiftingMode(false);
bnav.setTextVisibility(false);
bnav.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);