I am trying to implement ActionBar Sherlock with Tabs below that as shown in the above wire-frame.
Should i use TabActivity ? - since i saw that it is deprecated. Which is the best way to achieve the same.
I am trying to implement ActionBar Sherlock with Tabs below that as shown in the above wire-frame.
Should i use TabActivity ? - since i saw that it is deprecated. Which is the best way to achieve the same.
I implemented this functionality with a
SherlockFragmentActivity
as tabview container and withSherlockFragment
as tabs. Here is a sketch (I omitted the usual Android activity stuff):This is the tabview activity with two tabs:
And this is the
TabFragment
that holds a tab's content:And finally this is the
TabListener
that handles tab switches:I believe TabActivity is deprecated in favor of using Fragments -- not because tab navigation is a deprecated concept. Simply use Fragments and a TabWidget.
Also, here's a similar question.
Edit:
Here's an example courtesy of Google: Android Tabs the Fragment Way