So I have an app where in one of the screens there is a sliding menu (jfeinstein's) and I also want to implement a tab view using fragments. For this I need to extend the FragmentActivity but I have already extended SlidingActivity and I can't extend more than one class. Is there a way to work around this so that I have both a sliding menu and a tab menu in the same class?
1 Answers
Instead of extending the Activity you can integrate it, as listed in point 1 of the usage guidelines.
"You can wrap your Activities in a SlidingMenu by constructing it programmatically (new SlidingMenu(Context context)
) and then calling SlidingMenu.attachToActivity(Activity activity, SlidingMenu.SLIDING_WINDOW | SlidingMenu.SLIDING_CONTENT)
. SLIDING_WINDOW
will include the Title/ActionBar in the content section of the SlidingMenu, while SLIDING_CONTENT
does not. You can check it out in the example app AttachExample
Activity."
The SlidingMenu was written for a time when the navigation drawer pattern didn't have a native implementation in the SDK. There is one now: you can use the NavigationDrawer which is included in the v4 Support Library. There is a guide for that here on the developer pages.

- 15,195
- 7
- 50
- 92