scientiffic
scientiffic

Reputation: 9415

Android Tabs with List View

I followed this tutorial to created a tab activity using fragments:

http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/

One of the tabbed activities includes a list view; when you click on an item in the list view, it opens a new activity. But I want the new activity to still show the tabs that are in the tab activity. In other words, I want the tabs to show up on all the activities in the application, but I don't know how to make it persistent.

Would someone be able to point me in the right direction?

Upvotes: 1

Views: 1674

Answers (2)

ncn corp
ncn corp

Reputation: 111

You can add your tabview dynamically on every activity start.

Upvotes: 0

Avadhani Y
Avadhani Y

Reputation: 7636

To make your application persistent, make use of Inheritance. create listView.xml, tabactivity.xml and embed those in MainActivity.xml as below:

 <LinearLayout ... >
<include layout="@layout/listView" /> // your listview.xml file will be called
<include layout="@layout/tabactivity" />   // your tabactivity.xml file will be called
</LinearLayout>

Upvotes: 1

Related Questions