android tabs - 开始一个新的活动 [英] android tabs - starting a new activity

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

问题描述

TabHost 中有 4 个选项卡,分别为 A、B、C 和 D.现在每个选项卡都只是一个索引页面,单击其中任何一个显示不同的活动.

There are 4 Tabs in a TabHost, let them be A, B, C, and D. Now each one is just an index page and clicking on any of them shows a different activity.

问题是当用户从选项卡中显示的内容中选择某些内容时,我需要启动另一个活动.其他活动也应显示在父选项卡本身中.是否可以?还是我必须尝试其他方法?

The problem is that I need to start another activity when the user selects something from the content displayed in the tab. The other activity should also be displayed in the parent tab itself. Is it possible? Or will I have to try something else?

推荐答案

你不能改变你的 tab 的 contentView 而不是启动一个新的 Activity 吗?

Can't you change the contentView of your tab instead of starting a new Activity ?

也许我错了,但我也认为不可能在选项卡中启动活动,因为 TabView 托管在活动中,而不是相反(Tabview 不托管每个选项卡的活动).

Maybe I'm wrong but I think also that starting an activity in a tab isn't possible because the TabView is hosted in a activity and not the opposite (Tabview don't host an activity per Tab).

这篇关于android tabs - 开始一个新的活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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