安卓:TabActivity德precated,使用碎片? [英] Android: TabActivity deprecated, use Fragments?

查看:192
本文介绍了安卓:TabActivity德precated,使用碎片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看来,TabActivity现在是很precated,我们需要使用片段。

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

我试图用一个标准的活动,但不能叫getTabHost。

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?

所以我presume我不能在片段做startActivity?

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

有谁知道一个很好的例子,说明tabHost和片段,所有的例子和教程我发现只使用tabactivity的。

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.

在此先感谢

推荐答案

我有同样的东西,一个前两天,因此该解决方案是如此简单,只要到开发商的Andr​​oid。 这里是它在创建选项卡主机片段的链接。它帮助我。

I had the same stuff a couple of days ago, so the solution is so simple, just go to developer android. Here is the link which is creating the tab host with fragments. It helped to me.

这篇关于安卓:TabActivity德precated,使用碎片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆