There is such a code

jsoupClient.getNewsForCategory("/politics/") .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new DisposableSingleObserver<List<News>>() { @Override public void onSuccess(List<News> news) { newsView.showNews(news); } @Override public void onError(Throwable e) { } }); 

In the getNewsForCategory method I get an error on the line

  Document politic = Jsoup.connect(category).userAgent("Mozilla").get(); 

Though I launch in a child flow

  • Possible duplicate question: The application crashes when trying to use Jsoup - Sergey Gornostaev
  • I'm wondering why this behavior with rxjava and not how to do AsyncTask - Max
  • Because Jsoup.connect(category) throwing an error does not apply to RxJava. I don’t know how the getNewsForCategory() method was specifically written, but I suspect that RxJava is included in the process only in its most recent line, at the time of the return execution. - Sergey Gornostaev
  • Exactly, thank you ... - Maxim

0