void setupViewPager() { adapter = new customViewPagerAdapter(ChildFragmentManager); adapter.AddFragment(SmallFragment.newInstance("1"), "first"); adapter.AddFragment(SmallFragment.newInstance("2"), "second"); adapter.AddFragment(SmallFragment.newInstance("3"), "third"); adapter.AddFragment(SmallFragment.newInstance("4"), "fouth"); viewPager.Adapter = adapter; }
public static SmallFragment newInstance(string str) { SmallFragment fr = new SmallFragment(); Bundle args = new Bundle(); args.PutString("name", str); fr.Arguments = args; return(fr); }
void btn_Click(object sender, EventArgs e) { adapter.AddFragment(SmallFragment.newInstance("5"), "fifth"); adapter.NotifyDataSetChanged(); }