I try to implement an applicationbar with SWIPE tabs in my android project.
Lets say I’ve two tabs (tab1 and tab2). And I want to display different content on these tabs.
(Actually that’s all what I want to do nothing more).
Tab1 includes a list and Tab2 includes “another” list plus some text.
Is it possible to use two “activities” for the two tabs? (That’s what I’m doing now)
I use a custom adapter to set the lists content.
final ListView lv = (ListView)findViewById(R.id.tab1_list);
lv.setAdapter(new CustomListAdapter(this, tab1Items));
But I’m not able to display the tabs content correctly. Either they aren’t display at all, or they are display the same content.
Does anyone have some good ideas for me, or some little code examples, how to use a appbar with tabs and lists in it (that are using adapters)?
I’m very grateful for any help.
Here is the example what you want “A swipe Tab”:
Define the PagerAdapter :
Define the Tab FragmentActivity: