How to change Actionbar Tab from fragment
<p>i have 3 actionbar tabs home:video:purchase by default home will be selected.I can switch between different tabs where i'm able to replace the fragments.I have a gridview in home fragment on click of any grid cell i'm using the below piece of code to navigate to purchase tab,i'm able to replace the home fragment with purchase fragment but how can change the actionbar tab from home tab to purchase tab?????</p>

<pre><code>FragmentTransaction ft = parentActivity
                            .getFragmentManager()
                            .beginTransaction();
                    ft.replace(R.id.mainLayout,new purchase());
                    ft.commit();

class MyTabsListener implements ActionBar.TabListener {
        public Fragment fragment;

        public MyTabsListener(Fragment fragment) {
            this.fragment = fragment;
        }

        public void onTabReselected(Tab tab, FragmentTransaction ft) {
        }

        public void onTabSelected(Tab tab, FragmentTransaction ft) {
            if (fragment != null) {
                ft.setCustomAnimations(R.animator.fragmentanimatorleft,
                        R.animator.fragmentanimatorright);
                ft.replace(R.id.mainLayout, fragment);
                // isSettingClicked = false;

            }

        }

        public void onTabUnselected(Tab tab, FragmentTransaction ft) {
            if (fragment != null) {
                try {
                    ft.remove(fragment);
                } catch (Exception e) {
                    // TODO: handle exception
                }
            }
        }
</code></pre>
