title: How to make multiple request and wait until data is come from all the requests in retrofit 2.0 - android
body: <p>current code:</p>
  
  <pre><code>Retrofit retrofit = new Retrofit.Builder()
                    .baseUrl(Constant.BASEURL)
                    .addConverterFactory(GsonConverterFactory.create())
                    .build();
  
  APIService service = retrofit.create(APIService.class);
  
  Call&lt;ResponseWrap&gt; call = service.getNewsData();
  
  call.enqueue(new Callback&lt;ResponseWrap&gt;() {
  
    @Override
    public void onResponse(Call&lt;ResponseWrap&gt; call1, Response&lt;ResponseWrap&gt; response) {
      if (response.isSuccess()) {
  
          ResponseWrap finalRes = response.body();
          for(int i=0; i&lt;finalRes.getResponse().getResults().size(); ++i){
              String title = finalRes.getResponse().getResults().get(i).getWebTitle();
              News n = new News(titleCategory, title, null);
              newsList.add(n);
          }
  
          AdapterRecommendation adapter = new AdapterRecommendation(getApplicationContext(), newsList);
          listView.setAdapter(adapter);
  
      }
      else{
          Toast.makeText(getApplicationContext(), "onResponse  - something wrong" + response.message(), Toast.LENGTH_LONG).show();
      }
    }
  
    @Override
    public void onFailure(Call&lt;ResponseWrap&gt; call1, Throwable t) {
        Toast.makeText(getApplicationContext(), "exception: " + t.getMessage(), Toast.LENGTH_LONG).show();
    }
  });
  </code></pre>
  
  <p>works fine.</p>
  
  <p>Now i want to make multiple calls (number of call will be decided at run time) and all calls gives data in same format. data from all calls needs to be add to newsList. Once data is available from all calls and added to newsList, call</p>
  
  <pre><code>AdapterRecommendation adapter = new AdapterRecommendation(getApplicationContext(), newsList);
  listView.setAdapter(adapter);
  </code></pre>
  
  <p>Can anyone help me what is the best way to get data from multiple calls and wait until all request is not over in retrofit 2.0.</p>