"类型TabActivity是德precated"对于应用程序选项卡选项卡、应用程序、类型、QUOT

2023-09-06 19:08:41 作者:爱不倦

的类型TabActivity是德precated?

我在做应用程序的选项卡下面的教程书。

我已经从Android developer.com网站检查,但我有以下消息的意义没有想法:这个类是pcated德$ P $

新的应用程序应该使用片段,而不是此类;继续在旧设备上运行,则可以使用V4支持库,它提供了一个版本的片段API,它已经降到了DONUT兼容的。*(http://developer.android.com/reference/android/app/TabActivity的.html)

什么是V4支持库? 如何完成选项卡功能? 解决方案

您仍然可以使用去precated包。然而,应推荐使用的片段,因此,支持包。你可以阅读更多关于它这里。但是,如果你是一个初学者在Java和Android开发,我建议忽略了去precation现在回来到这个时候你已经完成了当前正在使用,如果你发现它教育教程。

如果你想观看使用片段tab导航的一个很好的例子,然后建立在Eclipse采用了android 4.0或更高版本的新项目。请确保您的Andr​​oid插件更新。您将得到选项来创建与已经实现基本的导航项目。

怎么从MainActivity跳转到有tabhost的TabActivity

"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 no ideas on the significance of the following message : This class is deprecated.

New applications should use Fragments instead of this class; to continue to run on older devices, you can use the v4 support library which provides a version of the Fragment API that is compatible down to DONUT."* (http://developer.android.com/reference/android/app/TabActivity.html)

What is v4 support library? How to finish the tab functions?

解决方案

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.