I tried using RxAndroid
button.setOnClickListener(view -> restApiFactory.testService().getListTest(7)
.subscribeOn(Schedulers.io())
.subscribe(new Observer<List<Test>>() {
but I got the following error :
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
I have not Used AndroidSchedulers.mainThread()
UI
should be updated from main thread , there is no escape from that..observeOn(AndroidSchedulers.mainThread())
before.subscribe(new Observer<List<Te...
AndroidSchedulers class
? you need to be specific regarding the issue and constraints