简体   繁体   English

TabbedActivity:单击按钮时,将我带到其他选项卡

[英]TabbedActivity: When click on a button take me to different tab

I have implemented 3 tabs using TabbedActivity. 我已经使用TabbedActivity实现了3个标签。 I have a button in tab1 when I click on it it should take me to the tab2 (just like what happens when I click on tab2). 当我单击tab1时,我在tab1中有一个按钮,它应该带我进入tab2(就像我单击tab2时所发生的一样)。 Can anyone help me out with this? 谁能帮我这个忙吗? Thanks in advance. 提前致谢。

use function : 使用功能:

getTabHost().setCurrentTab(int index);//getTabHost().setCurrentTab(1);

in your button click listener. 在您的按钮中,单击侦听器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM