I came upon this solution to use a Listfragment within a Tab of the Actionbar
- I face the same problem as described there, but somehow this solution doesn't work for me.
- I want to write an application for android versions greater than 4.0.
- I took the Android Sample code for generating Swipe View with tabs, if you generate a new Project and select: Fixed Tabs+Swipe
one Fragment should be a ListFragment, so I came upon this solution but the problem is the MainActivity uses the: import android.support.v4 support. Here is a part of my SectionsPagerAdapter the rest of the code is equal to the prelinked thread.
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a DummySectionFragment (defined as a static inner class
// below) with the page number as its lone argument.
Fragment fragment = null;
switch (position) {
case 0:
fragment = new ControlFragment();
case 1:
fragment = (Fragment)new WrapperListFragment();
}
return fragment;
}
I guess the code here useses the newer packages, so how to combine these two. In general i want to use the actionbar with swipe feature, and one fragment should display a listView.
Thanks in advance.