-1

I have my MainActivity that contains a navigation drawer with items. When I click on an item,it opens up a new activity. This activity has its own layout file. I want to call the navigation drawer in this activity as well. How do I do that? Because I want to navigate through the app using the navigation drawer,rather than pressing back button all the time.

Chintan Shah
  • 1,744
  • 2
  • 26
  • 28

1 Answers1

0

Let's say I have 2 activities, both of which I want to have the Navigation Drawer. In the layout.xml for each, I specified a DrawerLayout with the appropriate list view to hold my navigation options. Essentially, the Navigation drawer is made every time I switch between activities, giving the appearance that it is persisting. To make life a lot easier, I took the common methods required to set up the navigation drawer and put them in their own class: NavigationDrawerSetup.java. That way my activities can use the same custom adapter, etc.

Complete Reference : NavigationDrawer with Multiple Acivities

Community
  • 1
  • 1
Rajan Kali
  • 12,627
  • 3
  • 25
  • 37