Navigation drawer does not close when calling closeDrawers - timing issue

狂风中的少年 提交于 2019-12-05 22:10:15

as you mention it's about timing issue , the startActivity would be execute faster than closing the NavigationDrawer.about your second question you can set a DrawerListener for that and after your Navigation Closed completely start your second Activity :

mDrawerLayout.setDrawerListener(new DrawerListener() {

        @Override
        public void onDrawerStateChanged(int arg0) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onDrawerSlide(View arg0, float arg1) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onDrawerOpened(View arg0) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onDrawerClosed(View arg0) {

            GotoActivity();
        }
    });
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!