Back to project page ProjectStudio.
The source code is released under:
Apache License
If you think the Android project ProjectStudio 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 adapters; // w ww .java2s .c om import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import fragments.ExamsPassedFragment; import fragments.ExamsPendingFragment; /** * Created by desmond on 1/20/14. * * THE FRAGMENT PAGER PROVIDES FRAGMENT VIEWS TO TABS */ public class Exams_TabsPagerAdapter extends FragmentPagerAdapter { //DECLARE THE NUMBER OF PAGES final int PAGE_COUNT = 2; //CREATE AN ARRAY OF STRINGS TO CONTAIN TITLES OF THE TABS private String[] tab_titles = {"Passed", "Pending"}; public Exams_TabsPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int index) { switch (index) { case 0: //ExamsPassedFragment ExamsPassedFragment exams_passed = new ExamsPassedFragment(); return exams_passed; case 1: //ExamsPendingFragment ExamsPendingFragment exams_pending = new ExamsPendingFragment(); return exams_pending; } return null; } @Override public CharSequence getPageTitle(int position) { return tab_titles[position]; } @Override public int getCount() { // return the number of tabs return PAGE_COUNT; } }