Cannot resolve symbol 'AndroidSchedulers ' on AndroidSchedulers.mainThread() using implementation 'androidx.room:room-rxjava2:2.1.0'

lcj*_*lcj 0 android rx-java android-room

I am trying to follow a few code examples to pull a single record from the database to display, because it seems somewhat complicated to do so with LiveData. However, I am getting an error in the IDE.

无法解析符号“AndroidSchedulers”

在线上:

AndroidSchedulers.mainThread()
Run Code Online (Sandbox Code Playgroud)

在这次通话中:

        viewModel.getScenario(scenarioId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new DisposableSingleObserver<Scenario>() {
                    @Override
                    public void onSuccess(Scenario scenario) {

                    }
                });
Run Code Online (Sandbox Code Playgroud)

我的年级是这样的:

implementation 'androidx.room:room-rxjava2:2.1.0'
Run Code Online (Sandbox Code Playgroud)

KuL*_*Tel 6

implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'gradle. AndroidSchedulers.mainThread()rxandroid不是 的一部分rxjava2