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 meth
You're calling service.getData(httpParamObject) in the main thread and passing that result to Observable.just. So your subscribeOn has no effect.
service.getData(httpParamObject)
Observable.just
subscribeOn
Check the documentation of Observable.create and use it instead of Observable.just