Open next activity only after navigation drawer completes it closing animation

后端 未结 7 454
陌清茗
陌清茗 2020-12-30 10:13

I\'m using Navigation Drawer in my application.

When the user clicks on any of the menu item in drawer, it opens a new Activity (not fr

7条回答
  •  遥遥无期
    2020-12-30 10:52

    Don't close navigation drawer. It will slide with the old activity. Or call startActivity after drawerLayout.closeDrawer(drawerList);

    public void onItemClick(AdapterView parent, View view, int position, long id) {
        drawerLayout.closeDrawer(drawerList);
        Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
        //set animation here
        startActivity(intent);
        finish();
    }
    

提交回复
热议问题