Esempio n. 1
0
		void ListItemClicked (int position)
		{
			SupportFragmentManager.PopBackStack (null, (int)PopBackStackFlags.Inclusive);

			Log.Debug (Tag, "Item {0} has been selected.", position);

			Fragment fragment = null;
			switch (position) {
			case 0:
				fragment = new EventListFragment ();
				break;
			case 1:
				fragment = new AnimalListFragment ();
				break;
			case 2:
				fragment = new AboutFragment ();
				break;
			}

			// Insert the fragment by replacing any existing fragment
			SupportFragmentManager.BeginTransaction ()
				.Replace (Resource.Id.content_frame, fragment)
				.Commit ();

			// Highlight the selected item, update the title, and close the drawer
			drawerList.SetItemChecked (position, true);
			SupportActionBar.Title = sections [position];
			drawerLayout.CloseDrawer (drawerList);
		}
        void ListItemClicked(int position)
        {
            SupportFragmentManager.PopBackStack(null, (int)PopBackStackFlags.Inclusive);

            Log.Debug(Tag, "Item {0} has been selected.", position);

            Fragment fragment = null;

            switch (position)
            {
            case 0:
                fragment = new EventListFragment();
                break;

            case 1:
                fragment = new AnimalListFragment();
                break;

            case 2:
                fragment = new AboutFragment();
                break;
            }

            // Insert the fragment by replacing any existing fragment
            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();

            // Highlight the selected item, update the title, and close the drawer
            drawerList.SetItemChecked(position, true);
            SupportActionBar.Title = sections [position];
            drawerLayout.CloseDrawer(drawerList);
        }