📌  相关文章
📜  android 导航抽屉打开活动 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:15.034000             🧑  作者: Mango

代码示例1
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
        @Override
        public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
             int id=menuItem.getItemId();    
             if (id == R.id.xxx){
                  Intent newIntent = new Intent(this, NewActivity.class);
                  startActivity(newIntent);  
              }
              return true;
         }
      });