1. 引用
model.gradle
//rxAndroid
compile 'io.reactivex.rxjava2:rxjava:2.0.8'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
2. 简单调用
Observable.just(SqlStr)
.map(new Function<String, String>() {
@Override
public String apply(@NonNull String s) throws Exception {
return "";
}
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<String>() {
@Override
public void accept(@NonNull String s) throws Exception {
}
});