android - Volley priority doesn't work properly -


i have make 2 calls volley. problem need done first call , second. calls on loop. put on first call priority.immediate , on second priority.low. second call done before first , doesn't have data need first call. missing?

    (int = 0; < sitedata.getsites().size(); i++) {           firstcall();           secondcall();      } 

the firstcall method

private void firstcall(){     jsonobjectrequest sitedatarequest = new jsonobjectrequest(request.method.get, url, null, new response.listener<jsonobject>() {          @override          public void onresponse(jsonobject response) {             // json          }      }, new response.errorlistener() {         @override         public void onerrorresponse(volleyerror error) {           volleylog.d(membership_id_tag, error.getmessage());         }     })      {        @override        public priority getpriority() {           return priority.immediate;        }     };     appcontroller.getinstance().addtorequestqueue(sitedatarequest, membership_id_tag); } 

the secondcall method

private void secondcall(){     jsonarrayrequest pagesrequest = new jsonarrayrequest(request.method.get, url, null, new response.listener<jsonarray>() {        @override        public void onresponse(jsonarray response) {           // json         }      }, new response.errorlistener() {          @override          public void onerrorresponse(volleyerror error) {             volleylog.d(membership_page_tag, error.getmessage());          }       })        {           @override           public priority getpriority() {              return priority.low;           }       };       appcontroller.getinstance().addtorequestqueue(pagesrequest, membership_page_tag); } 

do have make first call on loop , second on other?

try doing serving call in response if first, priority might happening because there 2 different request queue being used.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -