title: wait for multiple volley responses in a for loop
body: <p>I am using volley singleton and add all volley request to it.</p>
  
  <p>sample code of adding volley request to queue</p>
  
  <pre><code>MyApplication.getInstance().addToReqQueue(jsObjRequest, "jreq1");
  </code></pre>
  
  <p>I have an onclick function.</p>
  
  <pre><code>buttonId.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
                      for(int i=0;i&lt;4;i++){
                       //....... here i call for asycn volley requests which get added to the queue of volleysingleton
  
                      }
  
                      // ******how to ensure all my volley requests are completed before i move to next step here.*****
  
  
                      //calling for new intent
                      Intent m = new Intent(PlaceActivity.this, Myplanshow.class);
                          m.putExtra("table_name", myplansLists.get(myplansLists.size() - 1).table_name);
                          m.putExtra("table_name_without_plan_number", myplansLists.get(myplansLists.size() - 1).place_url_name);
                          m.putExtra("changed", "no");
                          m.putExtra("plannumber", myplansLists.size());
  
                      //moving to new intent;
                          v.getContext().startActivity(m);
  
  }
              });
  </code></pre>
  
  <p>Inside onclick i have a for loop which will execute multiple volley requests.</p>
  
  <p>After the for loop it will start a new activity through intent.</p>
  
  <p>But for my new activity to show, i need the data of all the volley requests in the for loop to be completed before, it leaves this activity and goes to new activity.</p>