Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: TabActivity deprecated, use Fragments?

It appears that TabActivity is now deprecated, we need to use Fragments.

I tried using a standard Activity but couldn't call getTabHost.

So it appears i have to use Fragments. But i am a little confused how this would work.

I understand that fragments are not activities so they are not in the manifest file?

SO i presume i can't do startActivity on a fragment?

Does anyone know of a good example explaining the tabHost and Fragments, all the examples and tutorials i have found are only using the tabactivity.

Thanks in advance

like image 877
Martin Avatar asked Sep 12 '12 06:09

Martin


1 Answers

Maybe you could use TabLayout instead.

Tabs are now best implemented by leveraging the ViewPager with a custom "tab indicator" on top. Google's new TabLayout included in the support design library release for Android "M".

Visit the full tutorial of using TabLayout in Google Play Style Tabs using TabLayoutEdit PagePage History

like image 168
ישו אוהב אותך Avatar answered Oct 15 '22 16:10

ישו אוהב אותך