예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bundle"></param>
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activity_main);
            Bundle           args         = new Bundle();
            MainMenuFragment mainMenuFrag = MainMenuFragment.NewInstance(args);

            FragmentTransaction transaction = FragmentManager.BeginTransaction();

            transaction.Add(Resource.Id.main_menu_container, mainMenuFrag).Commit();
            _nfcAdapter = NfcAdapter.GetDefaultAdapter(this);
            _bluetooth  = new Bluetooth
            {
                Adapter = BluetoothAdapter.DefaultAdapter
            };

            string operation = Intent.GetStringExtra("Operation");
            string activity  = Intent.GetStringExtra("Activity");

            //if (activity == null)
            //    activity = "NFCUtilities";
            //if (operation == null)
            //    operation = "Application Run";
            //Toast.MakeText(Application.Context, string.Format("MainActivity {0} {1} {2} {3}", "Launch Intent Activity=", activity, ", Operation=", operation), ToastLength.Long).Show();

            LauchActivity(activity);
        }
예제 #2
0
        public static MainMenuFragment NewInstance(Bundle args)
        {
            //args.Put
            var mainMenuFrag = new MainMenuFragment {
                Arguments = args
            };

            return(mainMenuFrag);
        }
예제 #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.main_menu_fragment);

            var menu = MainMenuFragment.NewInstance();

            menu.NfcPairButtonClicked        += NfcPairButton_OnClick;
            menu.NfcUtilsButtonClicked       += NfcUtilsButton_OnClick;
            menu.BluetoothUtilsButtonClicked += BluetoothUtilsButton_OnClick;

            var fragmentTransaction = FragmentManager.BeginTransaction();

            fragmentTransaction.Add(Android.Resource.Id.Content, menu);
            fragmentTransaction.Commit();
        }