@SuppressWarnings("MissingPermission")
@RequiresPermission(anyOf = {
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION
})
public void startLocationUpdates(boolean checkLocationSettings) {
stopLocationUpdates();
locationUpdatesDisposable = locationSettingsCheck(checkLocationSettings)
.flatMapObservable(ignore -> locationUpdates()
.startWith(lastLocation()))
.map(this::transformLocation)
.toFlowable(BackpressureStrategy.LATEST)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(this::setLocation,
error -> Timber.e("Failed to get location updates", error));
}
RxLocationManager.java 文件源码
java
阅读 37
收藏 0
点赞 0
评论 0
项目:smart-asset-iot-android-demo
作者:
评论列表
文章目录