Skip to content

Commit

Permalink
Fix example app.
Browse files Browse the repository at this point in the history
  • Loading branch information
IvBaranov committed Nov 27, 2015
1 parent cccd677 commit db04f25
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<BluetoothDevice>() {
Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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,
Expand Down

0 comments on commit db04f25

Please sign in to comment.