1

I have an activity which must extends from another activity, so i cannot embed the SlidingMenu at the Activity level. from https://github.com/jfeinstein10/SlidingMenu i learned that i should call SlidingMenu.attachToActivity(Activity activity, SlidingMenu.SLIDING_WINDOW | SlidingMenu.SLIDING_CONTENT). Besides that, i want to replace listView to my customed ListFragment, that is:

getSupportFragmentManager()
.beginTransaction()
.replace(R.id.menu_frame, new SampleListFragment())
.commit();

But since my activity is not a subclass of FragmentActivity, so getSupportFragmentManager() would failed. And getFragmentManager() doesn't work too. Here are the details: Fragment add or replace not working. So, in short, i want attach a sliding menu to my activity, and i want the replace call success too, how can i achieve that?

Community
  • 1
  • 1
cameron
  • 2,976
  • 3
  • 23
  • 35

2 Answers2

1

please pay attention to this: see the last section "Using the fly-in app menu between Activities"

roMoon
  • 91
  • 10
  • 1
    Note that [link-only answers](http://meta.stackoverflow.com/tags/link-only-answers/info) are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference. – kleopatra Nov 17 '13 at 15:01
-1

Use this:

http://developer.android.com/training/implementing-navigation/nav-drawer.html

It's official Android Navigation Drawer. You don't need 3rd party libraries now.

Michał Z.
  • 4,119
  • 1
  • 22
  • 32