Created
September 14, 2014 15:11
-
-
Save olologin/1845a79870727730689f 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
Observable.create(new Observable.OnSubscribeFunc<Cursor>() { | |
@Override | |
public Subscription onSubscribe(Observer<? super Cursor> observer) { | |
try { | |
Cursor cursor = getCursor(); | |
observer.onNext(cursor); | |
observer.onCompleted(); | |
} catch (Exception e) { | |
observer.onError(e); | |
} | |
return Subscriptions.empty(); | |
} | |
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(new Action1<Cursor>() { | |
@Override | |
public void call(Cursor cursor) { | |
adapter.changeCursor(cursor); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment