content: package com.androguide.universal.init.d;
  
  import java.util.ArrayList;
  
  import android.content.Context;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentPagerAdapter;
  import android.support.v4.app.FragmentTransaction;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.TextView;
  
  import com.actionbarsherlock.app.ActionBar;
  import com.actionbarsherlock.app.ActionBar.Tab;
  import com.actionbarsherlock.app.SherlockFragmentActivity;
  import com.actionbarsherlock.view.Menu;
  import com.actionbarsherlock.view.MenuInflater;
  import com.jfeinstein.jazzyviewpager.JazzyViewPager;
  import com.jfeinstein.jazzyviewpager.JazzyViewPager.TransitionEffect;
  
  public class Main extends SherlockFragmentActivity {
  
  	JazzyViewPager mViewPager;
  	TabsAdapter mTabsAdapter;
  	TextView tabCenter;
  	TextView tabText;
  
  	int current;
  
  	@Override
  	public void onCreate(Bundle savedInstanceState) {
  		super.onCreate(savedInstanceState);
  
  		mViewPager = new JazzyViewPager(this);
  		mViewPager.setId(R.id.pager);
  		setContentView(mViewPager);
  
  		// Setup the actionbar & tabs navigation
  		ActionBar bar = getSupportActionBar();
  		bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  		getSupportActionBar().setIcon(R.drawable.ic_launcher);
  		getSupportActionBar().setDisplayShowTitleEnabled(true);
  
  		mTabsAdapter = new TabsAdapter(this, mViewPager);
  
  		mTabsAdapter.addTab(bar.newTab().setText("Init.d"), Initd.class, null);
  		mTabsAdapter.addTab(bar.newTab().setText("About"), About.class, null);
  
  		// Set the JazzyViewPager desired transition effect
  		mViewPager.setTransitionEffect(TransitionEffect.CubeOut);
  	}
  
  	public static class TabsAdapter extends FragmentPagerAdapter implements
  			ActionBar.TabListener, JazzyViewPager.OnPageChangeListener {
  		private final Context mContext;
  		private final ActionBar mActionBar;
  		private final JazzyViewPager mViewPager;
  		private final ArrayList<TabInfo> mTabs = new ArrayList<TabInfo>();
  
  		static final class TabInfo {
  			private final Class<?> clss;
  			private final Bundle args;
  
  			TabInfo(Class<?> _class, Bundle _args) {
  				clss = _class;
  				args = _args;
  			}
  		}
  
  		public TabsAdapter(SherlockFragmentActivity activity,
  				JazzyViewPager pager) {
  			super(activity.getSupportFragmentManager());
  			mContext = activity;
  			mActionBar = activity.getSupportActionBar();
  			mViewPager = pager;
  			mViewPager.setAdapter(this);
  			mViewPager.setOnPageChangeListener(this);
  		}
  
  		public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
  			TabInfo info = new TabInfo(clss, args);
  			tab.setTag(info);
  			tab.setTabListener(this);
  			mTabs.add(info);
  			mActionBar.addTab(tab);
  			notifyDataSetChanged();
  		}
  
  		@Override
  		public int getCount() {
  			return mTabs.size();
  		}
  
  		@Override
  		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) {
  			mActionBar.setSelectedNavigationItem(position);
  		}
  
  		public void onPageScrollStateChanged(int state) {
  		}
  
  		public void onTabSelected(Tab tab, FragmentTransaction ft) {
  			Object tag = tab.getTag();
  			for (int i = 0; i < mTabs.size(); i++) {
  				if (mTabs.get(i) == tag) {
  					mViewPager.setCurrentItem(i);
  				}
  			}
  		}
  
  		public void onTabUnselected(Tab tab, FragmentTransaction ft) {
  		}
  
  		public void onTabReselected(Tab tab, FragmentTransaction ft) {
  		}
  
  		@Override
  		public Object instantiateItem(ViewGroup container, final int position) {
  			Object obj = super.instantiateItem(container, position);
  			mViewPager.setObjectForPosition(obj, position);
  			return obj;
  		}
  
  		@Override
  		public boolean isViewFromObject(View view, Object object) {
  			if (object != null) {
  				return ((Fragment) object).getView() == view;
  			} else {
  				return false;
  			}
  		}
  	}
  
  	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  		inflater.inflate(R.menu.main, menu);
   	}
  
  }