kiran
kiran

Reputation: 3264

how to change the Tab focus in tabhost?

I am new to Android.

I am implementing coding related to tab host.

I created three tabs named tab1,tab2,tab3 in tab host.

When i am starting my application tab1 is automatically fired.

My intention is when i am starting my application tab2 is fired automatically.

with out changing thee positions.

if any one has idea please help me

Thanks in advance

Upvotes: 3

Views: 2334

Answers (1)

Arjun
Arjun

Reputation: 1711

Not sure I quite understand your question. If you want to set the active tab to tab #2 do the following..

TabHost tabHost = getTabHost();
tabHost.setCurrentTab(1);

TabHost.setCurrentTab sets the active tab by index. Tab 1 has index 0, Tab 2 has index 1 and so on..

Upvotes: 5

Related Questions