MarathiActivity.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:Lang_Tutor 作者:
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_marathi);

    // Find the view pager that will allow the user to swipe between fragments
    ViewPager viewPager = (ViewPager) findViewById(R.id.marathi_viewpager);

    // Create an adapter that knows which fragment should be shown on each page
    MarathiCategoryAdapter adapter = new MarathiCategoryAdapter(this,getSupportFragmentManager());

    // Set the adapter onto the view pager
    viewPager.setAdapter(adapter);

    // Find the tab layout that shows the tabs
    TabLayout tabLayout = (TabLayout) findViewById(R.id.marathi_tabs);

    // Connect the tab layout with the view pager. This will
    //   1. Update the tab layout when the view pager is swiped
    //   2. Update the view pager when a tab is selected
    //   3. Set the tab layout's tab names with the view pager's adapter's titles
    //      by calling onPageTitle()
    tabLayout.setupWithViewPager(viewPager);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号