unreachable statement because of the switch statement on nv = (NavigationView) findViewById(R.id.nav)
nv = (NavigationView) findViewById(R.id.nav);
nv.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_posts:
Intent iMenuPosts = new Intent(getApplicationContext(), PostsActivity.class);
startActivity(iMenuPosts);
break;
it says that this part of the code is unreachable
case R.id.menu_don:
Intent imMenuDon = new Intent(getApplicationContext(), DonActivity.class);
startActivity(imMenuDon);
}
return true;
}
});
}
}