【发布时间】:2016-04-12 15:19:22
【问题描述】:
在我的应用程序中,我需要等待用户位置,然后执行改造(收到位置时)。
我有可观察的工作
mlocationService.getLocation()
.timeout(LOCATION_TIMEOUT_SECONDS, TimeUnit.SECONDS)
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(location -> {
Log.d(TAG, "COORDS: " + location.getLatitude() + ", " + location.getLongitude());
}, e -> Log.e(TAG, e.getMessage()));
但是现在我需要通过改造调用来调用第二个 observable,有没有比将第二个 observable 嵌套在第一个的 onNext() 中更好的方法?
谢谢
【问题讨论】:
标签: android retrofit rx-java rx-android