Networkonmainthreadexception With Retrofit-beta2 And Rxjava
I recently upgraded from retroft-beta1 and this was working. I have the following interface for the API: public interface Service { @POST('path') Observable
Solution 1:
From retrofit-beta2, calls to Observable methods now behave synchronously. So subscribeOn
must be used:
service.service()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe();
Post a Comment for "Networkonmainthreadexception With Retrofit-beta2 And Rxjava"