use of pl.charmas.android.reactivelocation.sample.utils.ToMostProbableActivity in project Android-ReactiveLocation by mcharmas.
the class MainActivity method onLocationPermissionGranted.
@Override
protected void onLocationPermissionGranted() {
lastKnownLocationSubscription = lastKnownLocationObservable.map(new LocationToStringFunc()).subscribe(new DisplayTextOnViewAction(lastKnownLocationView), new ErrorHandler());
updatableLocationSubscription = locationUpdatesObservable.map(new LocationToStringFunc()).map(new Func1<String, String>() {
int count = 0;
@Override
public String call(String s) {
return s + " " + count++;
}
}).subscribe(new DisplayTextOnViewAction(updatableLocationView), new ErrorHandler());
addressSubscription = addressObservable.subscribe(new DisplayTextOnViewAction(addressLocationView), new ErrorHandler());
activitySubscription = activityObservable.map(new ToMostProbableActivity()).map(new DetectedActivityToString()).subscribe(new DisplayTextOnViewAction(currentActivityView), new ErrorHandler());
}
Aggregations