protected override void OnResume() { base.OnResume(); // Ensures Bluetooth is enabled on the device. If Bluetooth is not currently enabled, // fire an intent to display a dialog asking the user to grant permission to enable it. if (!mBluetoothAdapter.IsEnabled) { if (!mBluetoothAdapter.IsEnabled) { Intent enableBtIntent = new Intent(BluetoothAdapter.ActionRequestEnable); StartActivityForResult(enableBtIntent, REQUEST_ENABLE_BT); } } // Initializes list view adapter. mLeDeviceListAdapter = new LeDeviceListAdapter(this); ListAdapter = mLeDeviceListAdapter; ScanLeDevice(true); }
protected override void OnResume () { base.OnResume (); // Ensures Bluetooth is enabled on the device. If Bluetooth is not currently enabled, // fire an intent to display a dialog asking the user to grant permission to enable it. if (!mBluetoothAdapter.IsEnabled) { if (!mBluetoothAdapter.IsEnabled) { Intent enableBtIntent = new Intent (BluetoothAdapter.ActionRequestEnable); StartActivityForResult (enableBtIntent, REQUEST_ENABLE_BT); } } // Initializes list view adapter. mLeDeviceListAdapter = new LeDeviceListAdapter (this); ListAdapter = mLeDeviceListAdapter; ScanLeDevice (true); }