From db04f256ab55ad8939b171a56c5447ef261f70f7 Mon Sep 17 00:00:00 2001 From: Ivan Baranov Date: Fri, 27 Nov 2015 17:25:51 +0300 Subject: [PATCH] Fix example app. --- .../ivbaranov/rxbluetooth/example/MainActivity.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/github/ivbaranov/rxbluetooth/example/MainActivity.java b/app/src/main/java/com/github/ivbaranov/rxbluetooth/example/MainActivity.java index a6779ea..e3b275d 100644 --- a/app/src/main/java/com/github/ivbaranov/rxbluetooth/example/MainActivity.java +++ b/app/src/main/java/com/github/ivbaranov/rxbluetooth/example/MainActivity.java @@ -39,12 +39,12 @@ public class MainActivity extends AppCompatActivity { stop = (Button) findViewById(R.id.stop); result = (ListView) findViewById(R.id.result); - rxBluetooth = new RxBluetooth(); + rxBluetooth = new RxBluetooth(this); if (!rxBluetooth.isBluetoothEnabled()) { rxBluetooth.enableBluetooth(this, REQUEST_ENABLE_BT); } - deviceSubscription = rxBluetooth.observeDevices(this) + deviceSubscription = rxBluetooth.observeDevices() .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Action1() { @@ -53,7 +53,7 @@ public class MainActivity extends AppCompatActivity { } }); - discoveryStartSubscription = rxBluetooth.observeDiscovery(this) + discoveryStartSubscription = rxBluetooth.observeDiscovery() .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .filter(Action.isEqualTo(BluetoothAdapter.ACTION_DISCOVERY_STARTED)) @@ -63,7 +63,7 @@ public class MainActivity extends AppCompatActivity { } }); - discoveryFinishSubscription = rxBluetooth.observeDiscovery(this) + discoveryFinishSubscription = rxBluetooth.observeDiscovery() .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .filter(Action.isEqualTo(BluetoothAdapter.ACTION_DISCOVERY_FINISHED)) @@ -73,7 +73,7 @@ public class MainActivity extends AppCompatActivity { } }); - bluetoothStateOnSubscription = rxBluetooth.observeBluetoothState(this) + bluetoothStateOnSubscription = rxBluetooth.observeBluetoothState() .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .filter(Action.isEqualTo(BluetoothAdapter.STATE_ON)) @@ -83,7 +83,7 @@ public class MainActivity extends AppCompatActivity { } }); - bluetoothStateOtherSubscription = rxBluetooth.observeBluetoothState(this) + bluetoothStateOtherSubscription = rxBluetooth.observeBluetoothState() .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .filter(Action.isEqualTo(BluetoothAdapter.STATE_OFF, BluetoothAdapter.STATE_TURNING_OFF,