All I want to do is a horizontal carousel in Android.
If I have 3 screens A B and C then I want my ViewPager to allow me to move like A <-> B, B <-> C, C <->
Implement the getItem(int position)
like this:
public Fragment getItem(int position)
{
switch(position)
{
case 0:
Fragment A = new A();
return A;
case 1:
Fragment B = new B();
return B;
same for C....
}
}
you can also have a look at here: SimpleViewPager.. download the source and understand it. Hope it helps.