I am developing a application in which i am using Tab host without fragment. I want to remove action bar in particular Tab2Activity(Tab1 Tab2 Tab3).
The Tabs start from 0 and goes 0, 1, 2, 3...
If you're selecting Tab 1 use Tab 0.
@Override
public void onTabSelected(ActionBar.Tab tab,
FragmentTransaction fragmentTransaction) {
// When the given tab is selected, switch to the corresponding page in
// the ViewPager.
mViewPager.setCurrentItem(tab.getPosition());
if (tab.getPosition() == 0) {
Toast tab1SelectedToast = Toast.makeText(this, "Tab 1 Selected", Toast.LENGTH_LONG);
tab1SelectedToast.show();
ActionBar actionBar = getActionBar();
actionBar.hide();
} else {
ActionBar actionBar = getActionBar();
actionBar.show();
}
}