Back to project page utexas-utilities.
The source code is released under:
Apache License
If you think the Android project utexas-utilities listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nasageek.utexasutilities.adapters; /* w w w . j av a 2s .c o m*/ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import com.actionbarsherlock.app.SherlockFragment; import java.util.List; /** * The <code>PagerAdapter</code> serves the fragments when paging. * * @author mwho */ public class MyFragmentPagerAdapter extends FragmentPagerAdapter { int pos; private List<SherlockFragment> fragments; /** * @param fm * @param fragments */ public MyFragmentPagerAdapter(FragmentManager fm, List<SherlockFragment> fragments) { super(fm); this.fragments = fragments; } /* * (non-Javadoc) * @see android.support.v4.app.FragmentPagerAdapter#getItem(int) */ @Override public Fragment getItem(int position) { return this.fragments.get(position); } /* * (non-Javadoc) * @see android.support.v4.view.PagerAdapter#getCount() */ @Override public int getCount() { return this.fragments.size(); } @Override public String getPageTitle(int position) { return this.fragments.get(position).getArguments().getString("title"); } public void updateFragments(List<SherlockFragment> fragments) { this.fragments = fragments; } }