Skip to content Skip to sidebar Skip to footer

How To Support Tabs On Android 2.2+?

I'm trying to offer tab support for all Android versions 2.2 and above. Is there a way of achieving this without using any deprecated classes/methods?

Solution 1:

The Problem is as following: TabActivity is deprecated because it derives from ActivityGroup which is deprecated, too. Problems are, to start Activitys inside Tabs and don't break callbacks like onActivityResume. There are some 'Hacks' around which solve this but they are ALL relying on the deprecated LocalActivityManager. So I see no solution of using Tabs without ANY deprecated calls. Since Android 3.X google invented Fragments for this kind of things which are supported on lower Versions with the SupportPackage. You should definetly try them in Combination with the new ActionBar if you want to avoid deprecated classes/methods

EDIT: Link to FragmentTabs for further reference

Solution 2:

I recon with with the answer Rafael gave.

Instead of resorting to the TabActivity you can sill use the regular TabHost to show tabs in all versions of android.

Post a Comment for "How To Support Tabs On Android 2.2+?"