Open 401885064 opened 8 years ago
viewPagers = FragmentPagerItems.with(this).add("MyFragment 1", MyFragment.class).create(); viewPagerAdapter = new FragmentPagerItemAdapter(getSupportFragmentManager(), viewPagers); viewPager.setAdapter(viewPagerAdapter); stlTabs.setViewPager(viewPager);
viewPagers.add(FragmentPagerItem.of("MyFragment 2", MyFragment.class)); viewPagerAdapter.notifyDataSetChanged(); stlTabs.setViewPager(viewPager);
How to add a page dynamically, such as a new page by clicking the + button