Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Window.RequestFeature(WindowFeatures.NoTitle); // Hide the title Bar.
            // Set view from the layout resource
            SetContentView(Resource.Layout.Monitor);

            Bundle bundle = Intent.GetBundleExtra("bundle");

            if (savedInstanceState != null)
            {
                path = savedInstanceState.GetString("path");
            }
            ParcelableDiscoverInfo parcel = bundle.GetParcelable("info") as ParcelableDiscoverInfo;

            if (parcel == null)
            {
                return;
            }
            robinInfo = parcel.info;

            Button btnConnect = FindViewById <Button>(Resource.Id.btnConnect);

            btnConnect.Click += BtnConnect_Click;
            BtnConnect_Click(btnConnect, EventArgs.Empty);

            FragmentTransaction fragmentTransaction = FragmentManager.BeginTransaction();
            MonitorTreeFragment myFrag = new MonitorTreeFragment();

            activeFragment = myFrag;
            // work here to change Activity fragments (add, remove, etc.).  Example here of adding.
            fragmentTransaction.Replace(Resource.Id.fragment_container, activeFragment);
            fragmentTransaction.SetTransition(FragmentTransit.FragmentFade);
            fragmentTransaction.Commit();
        }
Ejemplo n.º 2
0
        private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            tmr.Stop();
            tmr.Dispose();
            DiscoveryInfo          info   = discover.dicoveryMap.ElementAt(e.Position).Value;
            ParcelableDiscoverInfo parcel = new ParcelableDiscoverInfo();

            parcel.info = info;

            Bundle bundle = new Bundle();

            bundle.PutParcelable("info", parcel);
            Intent subActivity = new Intent(this, typeof(MonitorActivity));

            subActivity.PutExtra("bundle", bundle);
            StartActivity(subActivity);
        }