I have four tabs in tabbar. Whenever I launch my application I need to run all the tabs (four) of a tabbar, because all the tabs contains webviews that should be loaded whenever the app is launched. But the first tab should gets highlighted. I have used
setCurrentTab(0);
to load the first tab,but iam unable to load remaining tabs without clicking.
To do this, first create a xml file. The sample file is shown as below.
Each layout will refer to a unique layout.
In main activity use following
You can add as many tabs needed. And this all will be initialized at same time.
I hope this helps you 🙂