Beispiel #1
0
        const string WorldResourceUrl = "api/frontend/challenges/9/posts.json";         // number is the challenge id

        public static DailyPlayFragment NewInstance(int position)
        {
            var f = new DailyPlayFragment();
            var b = new Bundle();

            b.PutInt("position", position);
            f.Arguments = b;
            return(f);
        }
        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();
        }