1

I did this guy's tutorial on how to make an ActionBar and followed his instructions to the letter. He made two tabs to show off two fragments, Fragment A and Fragment B.

I had an ExpandedListView on my launcher MainActivity before this and since MainActivity.xml now holds the fragment container for the tabs, how can I move the ExpandedListView to the first or second fragments?

Before I implemented ActionBar, my MainActivity.xml holds an ExpandableListView.

Then I implemented the ActionBar with two tabs, Fragment A and Fragment B. How do I move the ExpandableListView inside one of these tabs? I hope someone takes the time to read the guy's tutorial because it has almost the same layout as mine because I just copied it.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Mnemone
  • 111
  • 1
  • 2
  • 9

1 Answers1

1

I believe, there's no ExpandedListFragment. Probably, they decided not to support ExpandedListView as a fragment because ExpandedListView is a strange-looking UI control. You may want to consider using several ListFragments instead.

Alexander Kulyakhtin
  • 47,782
  • 38
  • 107
  • 158
  • Hello, I added more details on my question. :( – Mnemone May 14 '13 at 08:56
  • I believe you can define a layout for your fragment, that layout will contain your ExpandableListView. Then you inflate this layout in your fragment's onCreateView. This way you have your ExpandableListView as one of the views in your layout.Then in onCreateView you set an adapter for your ExpandableListView etc – Alexander Kulyakhtin May 14 '13 at 11:00
  • http://stackoverflow.com/questions/16578543/android-change-fragment-page im having a problem displaying a diffrent xml when the fragment is switched – Jacob Anthony Tonna May 16 '13 at 03:49