Ejemplo n.º 1
0
        private void BtnConnect_Click(object sender, EventArgs e)
        {
            // TODO: Dev deactivate

            Thread th = new Thread(() =>
            {
                bluetoothService = new BluetoothService(this);

                TransporterClass.bluetoothService = bluetoothService;

                barBot = new BarBot(bluetoothService);

                TransporterClass.barBot = barBot;


                if (bluetoothService.ConnectActivateBluetooth())
                {
                    barBot.GetIngridients(5000, TransporterClass.listContainer);

                    Thread.Sleep(750);

                    var newActivity = new Intent(this, typeof(CocktailListview));

                    StartActivity(newActivity);


                    this.Finish();

                    OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
                }
                else
                {
                    bluetoothService.ShowToastMessage("Could not connect", ToastLength.Long);
                }
            });

            th.Start();
        }