1

I have been able to create my navigation drawer following the example from AndroidDevelopers. I have to put this navigation drawer in all the activities, and in all of them, it will be exactly the same.

That's why I have thought about abstracting this part of the activity and setting a method such as showNavigationDrawer() in a different class, that would show all the navigation drawer. I don't know how to do this. Should I extend Activity in this new class or should I enter into parameters the activity and the context?

Thank you very much.

mxmolins
  • 289
  • 2
  • 4
  • 10

2 Answers2

0

I could suggest to you using Fragment so you won't have this problem.

FrancescoAzzola
  • 2,666
  • 2
  • 15
  • 22
  • Isn't it possible to do it without Fragments? Which are the advantages about using Fragments instead Activities in this case? – mxmolins Jul 22 '13 at 07:46
0

Check this:

Same Navigation Drawer in different Activities

Basically create a Base Activity implement Navigation drawer and other children activity inherit from this Base Activity.

Community
  • 1
  • 1
Yiding
  • 2,914
  • 3
  • 21
  • 16