1、菜单点击事件
navigationView.setNavigationItemSelectedListener(this);//报错
public boolean onNavigationtemSelected(MenuItem item){
switch (item.getItemId()){
case R.id.landInfo:
MainActivity.actionStart(MainActivity.this,LandInfoActivity.class);
break;
default:
}
mDrawerLayout.closeDrawers();
return true;
}
与
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener(){
@Override
public boolean onNavigationtemSelected(MenuItem item){
switch (item.getItemId()){
case R.id.landInfo:
MainActivity.actionStart(MainActivity.this,LandInfoActivity.class);
break;
default:
}
mDrawerLayout.closeDrawers();
return true;
}
});
NavigationView
最新推荐文章于 2021-05-26 16:49:36 发布