Skip to content Skip to sidebar Skip to footer

Switching Tabs Within Tabs

MainActivity.java public class MainActivity extends FragmentActivity { // Fragment TabHost as mTabHost private FragmentTabHost mTabHost; @Override protected void onCreate(

Solution 1:

you have to maintain your tab clicks and when you click on tab you have to manager a counter which is increment by click and when you click on tabs you will check that condition according to click counter...


Solution 2:

Ohk i will explain this step by step 1.Just take on class like singlton class or you should take one static int counter in any class. 2.when ever you click on tab then on tab clicklistner just first you check what is the value of counter if counter==1 then first activity call if counter==2 then 2nd activity call counter==3 then third activity call

and at the end just increase your counter and if counter>3 then counter=1 ;

counter is static so in whole execution of app it will be constant and same :)


Post a Comment for "Switching Tabs Within Tabs"