Android TabHost deprecated

后端 未结 3 1281
广开言路
广开言路 2020-12-30 14:33

I am creating application which will support Android 2.2 to Android 4.1. The TabHost is deprecated in Android version 3.2

3条回答
  •  一整个雨季
    2020-12-30 15:11

    There are many points to your question,

    1. TabHost is not deprecated yet. Recently Google deprecated TabActivity and ActivityGroup.
    2. Even if it deprecated, it doesn't mean it can't be used. If X is deprecated, it only means a better alternative named Y is there.

    Now to answer your question, You have more than one options

    1. You can use ActionBarSherlock as other answers suggests. (EDIT : ActionBarSherlock is now deprecated.)
    2. You can use TabHost with fragments, See my answer here for a good example. To use Fragment in pre 3.0 API's you need to use Google's support library.

提交回复
热议问题