public static OverviewFragment NewInstance(int position) { var f = new OverviewFragment(); var b = new Bundle(); b.PutInt("position", position); f.Arguments = b; return(f); }
public override Android.Support.V4.App.Fragment GetItem(int position) { if (position == 0) { return(ReflectionFeedFragment.NewInstance(position)); } else if (position == 1) { return(OverviewFragment.NewInstance(position)); } return(LeaderboardFragment.NewInstance(position)); }
void ListItemClicked(int position) { Android.Support.V4.App.Fragment fragment = null; switch (position) { case 0: fragment = DailyPlayFragment.NewInstance(position); break; case 1: fragment = LeaderboardFragment.NewInstance(position); break; case 2: fragment = OverviewFragment.NewInstance(position); break; case 3: var prefs = this.GetSharedPreferences("wlcPrefs", FileCreationMode.Private); var editor = prefs.Edit(); editor.Clear(); editor.Commit(); var intent = new Intent(this, typeof(MainActivity)); intent.AddFlags(ActivityFlags.ClearTask | ActivityFlags.NewTask); StartActivity(intent); return; break; } SupportFragmentManager.BeginTransaction() .Replace(Resource.Id.content_frame, fragment) .Commit(); this.drawerListView.SetItemChecked(position, true); SupportActionBar.Title = this.title = Sections [position]; this.drawerLayout.CloseDrawers(); }