Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Sultan Aljaradi
2,592 Pointsrotate viewpaper in android studio
My Qustion link in http://stackoverflow.com
http://stackoverflow.com/questions/26978797/rotate-viewpaper-in-android-studio
i have 3 viewPaper which is goes in sequence starting with first ViewPaper untile the last and third viewPaper but when i go after 3rd viewPaper it stop.
if any one help me to make the ratation after the 3rd viewPaper goes to the 1st viewPaper.
thanks
my code:
public int getCount() {
//the number of tabs
return 3;
}
public CharSequence getPageTitle(int position) {
String title = new String();
if(position==0){
return "Tab1";
}
if(position==1){
return "Tab2";
}
if(position==2){
return "Tab3";
}
return null;
}
@Override
public Fragment getItem(int i) {
Fragment fragment = null;
if (i == 0) {
fragment = new Fragment1();
}
if (i == 1) {
fragment = new Fragment2();
}
if (i == 2) {
fragment = new Fragment3();
}
return fragment;
}```
NOTE: the code is error FREE