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
Android Navigation Drawer Open On Activity Create
-
28-06-2022 - |
Domanda
I do have a simple requirement. I want new android Navigation Drawer to open upon start of Activity.
I have tried
mDrawerLayout.openDrawer(drawerListView);
in onCreate of host activity. But it didn't work.
Any kind of help would be appreciated. Thank you.
Soluzione
Altri suggerimenti
put this line
mDrawerLayout.openDrawer(drawerListView);
at the end of onCreate it workes fine.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow