title: Switching threads multiple times in Rx chain
body: <p>Let's assume I have a following case for Android:</p>
  
  <ol>
  <li>Request list of groups from network </li>
  <li>Show some UI elements for each group </li>
  <li>Request items for each group</li>
  <li>Show UI elemets for
  each item</li>
  </ol>
  
  <p>I want to do this using RxJava:</p>
  
  <pre><code>webService.requestGroups()
          .flatMap(group -&gt; {
              view.showGroup(group);
              return webService.requestItems(group);
          })
          .toList()
          .subscribeOn(Schedulers.io())
          .observeOn(AndroidSchedulers.mainThread())
  
          .subscribe(items -&gt; view.showItems(items));
  </code></pre>
  
  <p>As you can see I have 2 calls for view objects, each of them must be executed on main thread. And 2 calls for webService, which must be executed on background thread.</p>
  
  <p>The problem with this code: first call to view will be executed on background which cause an Android RuntimeException (Only original thread may touch views or something) If I transfer <code>.observeOn</code> to the beginning of chain - second webService call will be executed in main thread.</p>
  
  <p>How can I "swim" through threads multiple times in RxJava chain?</p>