How to hide a navigation drawer menu item programmatically?
Fixed it by creating a menu and using
menu.findItem(R.id.nav_target)
as @droid8421 suggested.
Fixed Code:
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
Menu menu =navigationView.getMenu();
MenuItem target = menu.findItem(R.id.nav_target);
target.setVisible(false);