Im building a project using web3.
web3j.ethGetBalance("0x2910543af39aba0cd09dbb2d50200b3e800a63d2", latestBlock)
.observable()
.subscribeOn(rx.schedulers.Schedulers.io())
//This needs to be on the main thread!
//But i only have access to rx.schedulers not AndroidSchedulers.mainThread()
.observeOn(rx.schedulers.Schedulers.io())
.subscribe(block -> {
ethereumTV.setText(block.getBalance() + "");
}, error -> {
error.printStackTrace();
});
But web3 uses an older version of RxJava and i cant access the mainThread to observe on it (To update text views etc)
Any ideas?
compile 'io.reactivex:rxandroid:1.2.1' // <-- this is needed
compile 'io.reactivex:rxjava:1.1.6'
Then you can get
in 'rx.Observable' cannot be applied to '(io.reactivex.Scheduler)'
In which case do
rx.android.AndroidSchedulers.mainThread()