Back to project page WineDB.
The source code is released under:
MIT License
If you think the Android project WineDB 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.selesse.android.winedb.activity; //from w ww . j a va 2 s . c o m import android.content.Context; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.util.Log; import com.selesse.android.winedb.database.Wine; import com.selesse.android.winedb.database.WineDatabaseHandler; public class WineCollectionPagerAdapter extends FragmentStatePagerAdapter { private static final String TAG = WineCollectionPagerAdapter.class.getSimpleName(); private Context context; public WineCollectionPagerAdapter(FragmentManager fm, Context context) { super(fm); this.context = context; } @Override public Fragment getItem(int position) { Wine wine = WineDatabaseHandler.getInstance(context).getWineNumber(position); Log.i(TAG, "getItem (" + position + "): " + wine.getName()); return SingleWineFragment.newInstance(wine.getId()); } @Override public int getItemPosition(Object object) { return POSITION_NONE; } @Override public int getCount() { return WineDatabaseHandler.getInstance(context).getWineCount(); } }