Ejemplo n.º 1
0
        private void ActiveBetFragment_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            var calculateBetFragment = new CalculateBetFragment()
            {
                Arguments = new Bundle()
            };

            calculateBetFragment.Arguments.PutString("PID", teams[e.Position - 1].Id.ToString());
            FragmentTransaction ft = this.Activity.FragmentManager.BeginTransaction();

            ft.Replace(Resource.Id.frameLayout1, calculateBetFragment, "CALCULATE");
            ft.Commit();
        }
Ejemplo n.º 2
0
        public override void OnBackPressed()
        {
            //List<Team> teams = new List<Team>();
            //try
            //{
            //    teams = AWSDataAccess.GetBetTeam(0);
            //}
            //catch (Exception exp)
            //{

            //    teams.Add(new Team()
            //    {
            //        Name = exp.Message,
            //        Bet = exp.Message
            //    });
            //}
            AddBetFragment addBetFragment = FragmentManager.FindFragmentByTag("AddBet") as AddBetFragment;

            if (addBetFragment != null && addBetFragment.IsVisible)
            {
                FragmentTransaction ft = FragmentManager.BeginTransaction();
                ft.Replace(Resource.Id.frameLayout1, new HomeFragment());
                ft.Commit();
                return;
            }

            ModifyBetFragment modBetFragment = FragmentManager.FindFragmentByTag("ModifyBet") as ModifyBetFragment;

            if (modBetFragment != null && modBetFragment.IsVisible)
            {
                FragmentTransaction ft = FragmentManager.BeginTransaction();
                ft.Replace(Resource.Id.frameLayout1, new HomeFragment());
                ft.Commit();
                return;
            }

            CalculateBetFragment fragment = FragmentManager.FindFragmentByTag("CALCULATE") as CalculateBetFragment;

            if (fragment != null && fragment.IsVisible)
            {
                FragmentTransaction ft = FragmentManager.BeginTransaction();
                ft.Replace(Resource.Id.frameLayout1, new ActiveBetFragment());
                ft.Commit();
                return;
            }

            Finish();
            Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
        }