Asynchronous RxJava Subscription Still Throws NetworkOnMainThreadException
<p>So after looking at other answers on here solving the same question it doesn't look like the solutions are working.  Here is the error I am getting.  I have my RxJava implementation on <code>newThread()</code> and the Observer on <code>mainThread()</code>.</p>

<p>So my first observable is emitting a Observable>.  I am iterating through it using <code>flatMapObservable</code> and using each integer to get single news items as a Observable.</p>

<p>Looking at my Http Log I am getting the list of integers and the first news item.  Then I am getting an error.</p>

<p>Any help would be greatly appreciated.</p>

<pre><code>mMainProvider.getNewestHackerStories()
            .subscribeOn(Schedulers.newThread())
            .observeOn(AndroidSchedulers.mainThread())
            .doOnError(Throwable::printStackTrace)
            .flatMapIterable(ids -&gt; ids)
            .flatMap(id -&gt; mMainProvider.getHackerNewsItem(id))
            .subscribe(hackerNewsItem -&gt; newStoryList.add(hackerNewsItem));
</code></pre>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>17-12017/com.androidtitan.magicmirror W/System.err: android.os.NetworkOnMainThreadException
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1273)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at com.android.org.conscrypt.OpenSSLSocketImpl.shutdownAndFreeSslNative(OpenSSLSocketImpl.java:1237)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at com.android.org.conscrypt.OpenSSLSocketImpl.close(OpenSSLSocketImpl.java:1232)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at okhttp3.internal.Util.closeQuietly(Util.java:105)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at okhttp3.internal.http.StreamAllocation.deallocate(StreamAllocation.java:259)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at okhttp3.internal.http.StreamAllocation.streamFailed(StreamAllocation.java:306)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at okhttp3.internal.http.HttpEngine.close(HttpEngine.java:478)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at okhttp3.RealCall.getResponse(RealCall.java:273)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:201)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at okhttp3.RealCall.execute(RealCall.java:57)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:171)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.Subscriber.setProducer(Subscriber.java:211)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.Subscriber.setProducer(Subscriber.java:205)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:50)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.Observable.unsafeSubscribe(Observable.java:8666)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:250)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:147)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:74)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.internal.operators.OnSubscribeFlattenIterable$FlattenIterableSubscriber.drain(OnSubscribeFlattenIterable.java:239)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.internal.operators.OnSubscribeFlattenIterable$FlattenIterableSubscriber.onNext(OnSubscribeFlattenIterable.java:130)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:227)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:107)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at android.os.Handler.handleCallback(Handler.java:739)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at android.os.Looper.loop(Looper.java:158)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:7224)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
08-04 21:27:16.766 12017-12017/com.androidtitan.magicmirror W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)</code></pre>
</div>
</div>
</p>