How to open Side bar on icon click in Android?

前端 未结 3 1432
小鲜肉
小鲜肉 2021-01-07 04:52

I have implemented Hamburger bar with App toolbar and both of them are working fine. Following is the snapshot of toolbar and ha

3条回答
  •  半阙折子戏
    2021-01-07 05:00

    Use the openDrawer() method.

    private DrawerLayout mDrawerLayout;
    ...
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    ...
    mDrawerLayout.openDrawer(Gravity.END); // or whatever gravity the of the drawer you want to open
    

提交回复
热议问题