Set A Tab From An Activity
I have a TabActivity and inside 5 tabs with 5 activities each one. I want to set one of my tabs but not from the TabActivity(clicking on the tab on the top) but from an activity of
Solution 1:
Say you have a MyTabActivity
as TabActivity
, which hosts 5 Activity
(ies).
If you want to change the Tabs inside SecondActivity
, you would write the code something like this.
MyTabActivitymyTabs= (MyTabActivity) this.getParent();
Here you have your MyTabActvity you can change the tabs like:
myTabs.getTabHost().setCurrentTab(index);
Post a Comment for "Set A Tab From An Activity"