Sunday, November 23, 2014

Android - Navigation Drawer example

1. Add DrawerLayout to xml file




















2. Add some codes to open/close drawer

















3. Implement menu content
In my case, I need to add views dynamically to uim.menu

4. Change main content when user selects a choice in menu
+ Change views in main content view respectively (in my case, it is a ViewFlipper)
+ Close showing menu (by calling closeDrawer(...))

-------------------------------------------------------------

I do not use ActionBar in the above example. You can reference this link for more detail:

No comments:

Post a Comment