Networkonmainthreadexception Using Okhttp With Rxjava2
I am trying to learn Rxjava2. I am facing a problem i.e, NetworkOnMainThreadException during network call using okHttp. I have to use only okHttp libary. This is my method where I
Solution 1:
You're calling service.getData(httpParamObject)
in the main thread and passing that result to Observable.just
. So your subscribeOn
has no effect.
Check the documentation of Observable.create and use it instead of Observable.just
Post a Comment for "Networkonmainthreadexception Using Okhttp With Rxjava2"