Last active
August 29, 2015 14:20
-
-
Save defHLT/688e8cb26dd5d83aea73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t.search(query) // Retrofit | |
.subscribeOn(Schedulers.io()) | |
.retry(3) | |
.observeOn(Schedulers.io()) | |
.subscribe(new Observer<List<SearchResult>>() { | |
@Override | |
public void onCompleted() { | |
} | |
@Override | |
public void onError(Throwable e) { | |
Timber.e(e, "onError"); | |
} | |
@Override | |
public void onNext(List<SearchResult> searchResults) { | |
ContentValues[] values = insertSearchResults(searchResults); | |
mResultObservable.onNext(values); | |
} | |
}); | |
mResultObservable | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(new Action1<ContentValues[]>() { | |
@Override | |
public void call(ContentValues[] contentValues) { | |
getActivity().... //! | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment