2
Good afternoon, I’m using the lib Bottomnavigationviewex to make a navigation bar for an Android app, but when will I use the methods "enableXXXX"
and the "setTextVisibility"
gives the error below. Does anyone know why and how to fix it? Thank you.
PS: the "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);
According to https://github.com/ittianyu/BottomNavigationViewEx/issues/52, can be the support library version.
– Lennoard Silva
Thanks, I didn’t try to change the version, but in the new version, their bottom navbar already lets you change what you needed via xml. I returned to the original navbar (Bottomnavigationview only).
– windowsXPPP