public static IObservable <BluetoothDevice> WhenDeviceEventReceived(this IAndroidContext context, string action) => context.WhenIntentReceived(action).Select(intent => { var device = (BluetoothDevice)intent.GetParcelableExtra(BluetoothDevice.ExtraDevice); return(device); });
public static IObservable <Unit> WhenAdapterStatusChanged(this IAndroidContext context) => context.WhenIntentReceived(BluetoothAdapter.ActionStateChanged).Select(_ => Unit.Default);