use of com.zhy.sample.fragment.SimpleFragment in project AndroidAutoLayout by hongyangAndroid.
the class CategoryActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_category);
mTabLayout = (TabLayout) findViewById(R.id.id_tablayout);
mViewPager = (ViewPager) findViewById(R.id.id_viewpager);
mViewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
@Override
public Fragment getItem(int i) {
return new SimpleFragment();
}
@Override
public CharSequence getPageTitle(int position) {
return mTabTitles[position];
}
@Override
public int getCount() {
return mTabTitles.length;
}
});
mTabLayout.setupWithViewPager(mViewPager);
}
Aggregations