Code example for ActionBar

Methods: addTabnewTab

0
			mActionBar = ab;
		} 
		 
		public void addTab(Fragment frag) {
			mFragments.add(frag);
			mActionBar.addTab(mActionBar.newTab().setTabListener(this).
					setText("Tab "+mFragments.size()));
		} 
		 
		@Override 
		public Fragment getItem(int position) {
			return mFragments.get(position);
		} 
 
		@Override 
		public int getCount() { 
			return mFragments.size();
		} 
 
		@Override 
Connect your IDE to all the code out there  Get Codota for Java