Question

I am using a Navigation Drawer currently with the Android Example. I plan to change this to using SlidingMenu Library as it's easier and provides easy customisation methods. I will also use the SherlockActionBar. I will have about 4-5 different Activities and each will have different ActionBar actions depending certain states. For all the Activities, I want to display the same Navigation Drawer/Sliding menu. Currently, I am using Fragments as per the Android Example to switch and inflate new Layouts each time a new item is selected from the drawer. As this is done inside the MainActivity, all four xml layout's share the same .java Activity file which makes it long and messy.

Using the SlidingMenu Library and SherlockActionBar, can I avoid Fragments and singular Activity and link the same Navigation Drawer/Sliding menu to all the Activites?

Était-ce utile?

La solution

Yes, you can use one SlidingMenu for all the activities. Make a separate base activity and implement slidingmenu in that Activity and extend all the activities in your project with that activity.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top