protected override void OnCreate(Bundle savedInstanceState) { // Set our view from the "main" layout resource RequestWindowFeature(Android.Views.WindowFeatures.ActionBar); //enable navigation mode to support tab layout UserTab userTab = this; userTab.ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; base.OnCreate(savedInstanceState); spinnerView = FindViewById <Spinner>(Resource.Id.spinner1); spinnerView.Adapter = new ArrayAdapter (this, Android.Resource.Layout.SimpleListItem1, myCategory); spinnerView.ItemSelected += MyItemSelectedMethod; SetContentView(Resource.Layout.usertab); _fragmentsArray = new Fragment[] { new Home("list1", this), new Review(this), new Review(this) }; AddTabToActionBar("Home"); //First Tab AddTabToActionBar("Favourite"); //Second Tab AddTabToActionBar("Review"); //Third Tab }
//private Fragment myContext; protected override void OnCreate(Bundle savedInstanceState) { // Set our view from the "main" layout resource RequestWindowFeature(Android.Views.WindowFeatures.ActionBar); //enable navigation mode to support tab layout UserTab userTab = this; userTab.ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.usertab); _fragmentsArray = new Fragment[] { new Profile(this, "res_list"), new Review(this), new NewEditScreen(this) }; AddTabToActionBar("Home"); //First Tab AddTabToActionBar("Review"); //Second Tab AddTabToActionBar("Profile"); //Third Tab }