TAGS :Viewed: 6 - Published at: a few seconds ago

[ Changing the deprecated TabActivity ]

I'm working on an android sample project, which makes use of TabActivity. But as this is deprecated now, I replaced it with the 'Fragment' activity. Now I don't know what to use, to replace,

TabHost tabHost = getTabHost()

which I had used while using TabActivity.

Also, setContentView(R.layout.main)

and setClass() in intent = new Intent().setClass() is giving an error.

Answer 1

You could use Action Bar Sherlock. This open source library gives you an action bar for every Android Version down to 1.6

This enables you to create tabs in the Honeycomb style with the Honeycomb APIs, therefore you do not need to use the deprecated tab APIs.