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.
Asked
Active
Viewed 1,197 times
-1

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

Simeon Mark Fernandes
- 107
- 2
- 11
1 Answers
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
-
I didn't understand your last statement. Please could you elaborate? , cause i am new to android. – Simeon Mark Fernandes Sep 25 '15 at 11:00