From 275e80b6a08536ef7d8473080461c4c67d97a2b6 Mon Sep 17 00:00:00 2001 From: Ivan Baranov Date: Thu, 16 Feb 2017 11:35:32 +0300 Subject: [PATCH] Update README.md. Fixes #12 --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 33e3946..159511d 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,19 @@ Usage 2. Create `RxBluetooth` instance. -3. Check if bluetooth is currently enabled and ready for use: +3. Check it: ```java + // check if bluetooth is supported on your hardware if (!rxBluetooth.isBluetoothAvailable()) { - // to enable blutooth via startActivityForResult() - rxBluetooth.enableBluetooth(this, REQUEST_ENABLE_BT); + // handle the lack of bluetooth support + } else { + // check if bluetooth is currently enabled and ready for use + if (!rxBluetooth.isBluetoothEnabled()) { + // to enable blutooth via startActivityForResult() + rxBluetooth.enableBluetooth(this, REQUEST_ENABLE_BT); + } else { + // you are ready + } } ```