I created a new navigation drawer activity from Android Studio 3.5 templates, but menu items are not clickable even though I\'m listening for NavigationItemSelected
**
For Menu Items Clickable
** NavController offers an OnDestinationChangedListener interface that is called when the NavController's current destination or its arguments change. A new listener can be registered via the addOnDestinationChangedListener() method. Note that when calling addOnDestinationChangedListener(), if the current destination exists, it is immediately sent to your listener.
////////////////////////////////////////////////////////////////////////
navController.addOnDestinationChangedListener(new NavController.OnDestinationChangedListener() {
@Override
public void onDestinationChanged(@NonNull NavController controller,
@NonNull NavDestination destination, @Nullable Bundle arguments) {
if(destination.getId() == R.id.gallery) {
//statements
} else {
//statements
}
}
});