Hello every body i made a weather application and i have 3 tabs i want to make tab 2 the default tab when i run the app
that's my code :
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
switch (position)
{
case 0:
Tab1 tab1=new Tab1();
return tab1;
case 1:
Tab2 tab2=new Tab2();
return tab2;
case 2:
Tab3 tab3=new Tab3();
return tab3;
}
return null;
}
@Override
public int getCount() {
// Show 3 total pages.
return 3;
}
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return "NextDay";
case 1:
return "Today";
case 2:
return "3rd Day";
}
return null;
}
}