I have noticed that when using
actionBar.setSelectedNavigationItem(x)
in the onCreate() method of my Activity, the tab item at position 0
you can use below statment in activtiy onStart method:
protected void onStart() {
super.onStart();
actionBar.selectTab(mainTab);
}
which mainTab variable here is of type Tab. this way you need to define tabs as class-wide variables like this:
Tab mainTab, tab2,tab3;
@Override
protected void onCreate(Bundle savedInstanceState) {
//add tabs to action bar
....
}