Code example for ActionBar

Methods: setSelectedNavigationItem

        public int getCount() { 
            return mTabs.size();
        public Fragment getItem(int position) {
            TabInfo info = mTabs.get(position);
            return Fragment.instantiate(mContext, info.clss.getName(), info.args);
        public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
        public void onPageSelected(int position) {
        public void onPageScrollStateChanged(int state) {
Connect your IDE to all the code out there  Get Codota for Java