Question

I am using feinstein's SlidingMenu library, I want to use the SlidingMenu in every activity i have. Should I have to write the SlidingMenu code in every activty?!, or can I write the slidingMenu in a class and start calling the class in every activity or is there any other way? Thanks in advance.

Was it helpful?

Solution

Best way would be to work with fragments. Add the drawer to your MainActivity extends FragmentActivity. Then add and remove fragments instead of switching activities.

Also, there's no need to use SlidingMenu anymore, Google added their own implementation, called NavigationDrawer to the Support Library. See http://developer.android.com/training/implementing-navigation/nav-drawer.html

OTHER TIPS

Simply create an abstract Activity that does that feature. than, each Activity will extend that basic abstract activity and you'll have the same behavior for them all.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top