Back to project page mitlocate.
The source code is released under:
MIT License
If you think the Android project mitlocate 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 edu.mit.locate.tabs; /* w w w . ja v a 2 s .co m*/ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import edu.mit.locate.R; import edu.mit.locate.alerts.AlertsTab; import edu.mit.locate.friends.FriendsTab; public class TabPagerAdapter extends FragmentPagerAdapter implements IconPagerAdapter { private static final String[] CONTENT = new String[] { //"Search", "Friends", //"Alerts", "Settings" }; private static final int[] ICONS = new int[] { //R.drawable.ic_tab_search, R.drawable.ic_tab_friends, //R.drawable.ic_tab_alerts, R.drawable.ic_tab_settings, }; public TabPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { switch (position) { //case 0: // return new SearchTab(); case 0: return new FriendsTab(); //case 1: // return new AlertsTab(); default: return new SettingsTab(); } } @Override public int getCount() { return CONTENT.length; } @Override public CharSequence getPageTitle(int position) { return CONTENT[position % CONTENT.length].toUpperCase(); } @Override public int getIconResId(int index) { return ICONS[index]; } }