Ejemplo n.º 1
0
        public override void OnReceive(Context context, Intent intent)
        {
            String action = intent.Action;

            if (BluetoothAdapter.ActionDiscoveryStarted.Equals(action))
            {
                DoDeviceDiscoveryStarted();
            }
            else if (BluetoothAdapter.ActionDiscoveryFinished.Equals(action))
            {
                DoDeviceDiscoverEnded();
            }
            else if (BluetoothDevice.ActionFound.Equals(action))
            {
                System.Diagnostics.Debug.WriteLine("Found a device");
                BluetoothDevice device = (BluetoothDevice)intent.GetParcelableExtra(BluetoothDevice.ExtraDevice);
                DoOnDeviceDiscovered(device.GetPairableBluetoothDevice());
            }
        }