Skip to content

Instantly share code, notes, and snippets.

@bjorncoltof
Created March 31, 2014 12:32
Show Gist options
  • Select an option

  • Save bjorncoltof/9891282 to your computer and use it in GitHub Desktop.

Select an option

Save bjorncoltof/9891282 to your computer and use it in GitHub Desktop.
OnCreate with GenericFragmentPagerAdapter
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
var adapter =
new GenericFragmentPagerAdapter(SupportFragmentManager,
new FragmentOne(), new FragmentTwo(), new FragmentThree());
var viewPager = FindViewById<Android.Support.V4.View.ViewPager>(Resource.Id.viewPager);
viewPager.Adapter = adapter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment