1

Is it possible to have a collapsible menu in a fragment, say for example...

Drinks
  Juice
  Soda
Main Dish
  Spaghetti Carbonara
  Pizzas

What I want to achieve is that, when I click the main menu "Drinks", I will collapse to show the submenu items.

If the collapsible thing is not possible, is it possible to hide the main menu then show only the submenus under the chosen main menu item?

for eg.

When I click the "Drinks" on the main menu, I will re-populate (well I don't know what's it called) the fragment with the submenu items. Is this achievable?

I read something about Fragments that I could not put another fragment on top of another one. Is this true?

mirageservo
  • 2,387
  • 4
  • 22
  • 31

1 Answers1

4

I believe you are looking for an ExpandableListView.

enter image description here

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
  • does this expandable gridview behaves well and that can be implemented inside a FrameActivity? or I am understanding this incorrectly? – mirageservo Jun 26 '12 at 00:27
  • [Differences between `Activity` and `FragmentActivity`](http://stackoverflow.com/questions/10477997/difference-between-activity-and-fragmentactivity). `FragmentActivity extends Activity` so it will work just the same. There is absolutely no difference between the two other than one works with the support package and the other doesn't. So yes, it will work fine with a `FragmentActivity` (just as it will work fine in an `Activity`). – Alex Lockwood Jun 26 '12 at 02:31
  • thanks, I think this is the most appropriate answer to my inquiry. – mirageservo Jun 26 '12 at 03:03