在TabHost活动 [英] Activity in TabHost

查看:161
本文介绍了在TabHost活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用TabHost。 下面code调用AActivity。

 意图=新的意图()setClass(这一点,AActivity.class)。
规格= tabHost.newTabSpec(A)setIndicator(A,res.getDrawable(R.drawable.icon))setContent(意向)。
tabHost.addTab(规范);
 

和它的标签。 但在AActivity我打电话BActivity。 的BActivity将打开新的一页,但不能在标签。 如何让它的标签帧? 低于code AActivity使用调用BActivity:

  IT =新的意图(这一点,BActivity.class);
startActivity(它);
 

解决方案

如果你想打开的选项卡多活动,然后在广场活动利用活动组的标准杆标签,并在该活动组切换视图打开多个活动单标签

您可以采取一些帮助,从本教程

I use a TabHost. The below code to call AActivity.

intent = new Intent().setClass(this, AActivity.class);
spec = tabHost.newTabSpec("A").setIndicator("A", res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

And it is in the tab. But in AActivity I call BActivity. The BActivity will open new page, but not in the tab. How to let it on the tab frame? AActivity use below code to call BActivity:

it = new Intent(this, BActivity.class);
startActivity(it);

解决方案

If you want to open multiple activity in Tab then on Place of activity use Activity group for par tab and switch view in this activity group for open multiple Activity in single tab

you can take some help from this tutorial

这篇关于在TabHost活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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