Android的导航抽屉打开在活动创建
问题描述:
我有一个简单的要求。
我想新的Android导航抽屉在活动开始打开。
I do have a simple requirement. I want new android Navigation Drawer to open upon start of Activity.
我曾尝试
mDrawerLayout.openDrawer(drawerListView);
在主机活动中的onCreate。
但它并没有正常工作。
in onCreate of host activity. But it didn't work.
任何形式的帮助将是AP preciated。
谢谢你。
Any kind of help would be appreciated. Thank you.
答
尝试移动code到 onResume()
,并设置一个标志,动作这样做也不会发生,每次活动推移前景
try to move the code to onResume()
and set a flag that the action is done so it won't happen every time activity goes foreground