“The type TabActivity is deprecated” For app tab

前端 未结 2 1078
误落风尘
误落风尘 2021-01-14 12:28

\"The type TabActivity is deprecated\"?

I am making the Tabs of app following tutorial book.

I\'ve checked from the android developer.com website, but i have

相关标签:
2条回答
  • 2021-01-14 12:57

    You can still use a deprecated package. It is however recommended to use Fragments, and thus the support package. You can read more about it here. However, if you are a beginner at java and android development, I would recommend ignoring the deprecation for now and come back to this when you have completed the tutorial you are currently using if you find it educating.

    If you want to watch a nice example of tabbed navigation using Fragments, then create a new project in Eclipse using android 4.0 or later. Make sure your android-plugin is updated. You will get the option to create a project with basic navigation already implemented.

    0 讨论(0)
  • 2021-01-14 13:02

    "Deprecated" means that the api developers don't recommend using it anymore, probably because its not a good model, or inefficient, etc. Fragments were introduced in Honeycomb and can be used to provide a similar functionality as tabs and is more in-line with android's current design philosophy.

    Since Fragment was introduced in Android 3.0 Honeycomb, you might think you cannot use that for pre-Honeycomb devices. Enter Support Libraries. They are libraries which you can include in your application which needs to run on pre-Honeycomb and still use this class.

    So if you want to, you can finish the TabActivity as described in whatever tutorial you are following, it'll probably work on a few more upcoming android versions. But it is recommended that you start using Fragments.

    0 讨论(0)
提交回复
热议问题