Back to project page campus.
The source code is released under:
GNU General Public License
If you think the Android project campus 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 lecho.app.campus.adapter; /*w w w. j a v a2s .co m*/ import lecho.app.campus.fragment.PlaceDetailsFragment; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.util.Log; public class PlaceDetailsFragmentAdapter extends FragmentStatePagerAdapter { private static final String TAG = "PlaceDetailsFragmentAdapter"; long[] mPlaceIdList; public PlaceDetailsFragmentAdapter(FragmentManager fm, long[] placeIdList) { super(fm); if (null == placeIdList) { Log.e(TAG, "Id list cannot be null for PlaceDetailsFragmentAdapter"); throw new IllegalArgumentException("Id list cannot be null for PlaceDetailsFragmentAdapter"); } mPlaceIdList = placeIdList; } @Override public Fragment getItem(int position) { Long placeId = mPlaceIdList[position]; return PlaceDetailsFragment.newInstance(placeId); } public long getItemId(int position){ return mPlaceIdList[position]; } @Override public int getCount() { return mPlaceIdList.length; } }