title: Chaining retrofit call with RxJava
body: <p>So basically what I'm trying to do is, make a first network call. And if the called RESTful web service returns 1, make a second network call. If the web service returns 0, then do not make the second network call. </p>
  
  <p>Here's my code</p>
  
  <pre><code>final ApiInterface apiInterface=restAdapter.create(ApiInterface.class);
  apiInterface.submitDataToAnalyze("dataToAnalyze","852741963",1,"123","lalala","2015-11-20")
     .flatMap(new Func1&lt;BasicResponse, Observable&lt;?&gt;&gt;() {
      @Override
      public Observable&lt;?&gt; call(BasicResponse basicResponse) {
          if (basicResponse.getResult() == 1){
             return apiInterface.getSuggestion("dataToAnalyze","852741963",1,"123","lalala","2015-11-20");
           }else{
              return 0; //error
           }
    }
  }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
  </code></pre>
  
  <p>Obviously the code above is wrong, since it should always return Observable. So how should my code be written, if the first network call returns 0? </p>