Android Studio - Error using Bottomnavigationviewex methods

Asked

Viewed 62 times

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);
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.