public MockActiveTappiesImpl(Scheduler ioScheduler) {
this.ioScheduler = ioScheduler;
tappyObs = Observable.create(new Observable.OnSubscribe<Set<TappyBleDeviceDefinition>>() {
@Override
public void call(final Subscriber<? super Set<TappyBleDeviceDefinition>> subscriber) {
final ActiveTappiesListener listener = new ActiveTappiesListener() {
@Override
public void onUpdatedList(Set<TappyBleDeviceDefinition> tappies) {
subscriber.onNext(tappies);
}
};
MockActiveTappiesImpl.this.registerListener(listener);
subscriber.add(Subscriptions.create(new Action0() {
@Override
public void call() {
MockActiveTappiesImpl.this.unregisterListener(listener);
}
}));
subscriber.onNext(tappyList);
}
}).subscribeOn(ioScheduler);
}
MockActiveTappiesImpl.java 文件源码
java
阅读 13
收藏 0
点赞 0
评论 0
项目:TappyBLE
作者:
评论列表
文章目录