I want to hide a menu item of BottomNavigationView dynamically based on some conditions. I tried the following but it is not working.
mBottomNavigationView.g
It works for me in kotlin like this:
bottomNavigationView.rootView.findViewById(R.id.nav_nearestRestaurant).visibility = View.GONE
But the thing is that if you click in another item, the hidden item appears again, because the bottom bar reload its appearance when show you the active item (so if in your xml menu, its visible, appears visible again (I think, to me happen like that))