Android Volley + Java : set object's field from callback interface -


i have maybe silly question.

i'm using volley library network communication :

getgeocodingresults(finaldepartureurl, new ivolleycallback() {                  @override                  public void onsuccess(jsonobject jsonobject) {                        handlevolleyresponse(jsonobject, order, 1);                   }             });  // getgeocodingresults method :     private void getgeocodingresults(string url, final ivolleycallback ivolleycallback)     {          requestqueue queue = volley.newrequestqueue(getactivity());         jsonobjectrequest jsonobjreq = new jsonobjectrequest(request.method.get,                 url.tostring(), null,                 new response.listener<jsonobject>() {                     @override                     public void onresponse(jsonobject response) {                         ivolleycallback.onsuccess(response);                     }                 }, new response.errorlistener() {              @override             public void onerrorresponse(volleyerror error) {                 volleylog.d(tag, "error: " + error.getmessage());                 // hide progress dialog             }         });         queue.add(jsonobjreq);      } 

handlevolleyresponse method point - want set order's field value :

private void handlevolleyresponse(jsonobject jsonobject, order order, int flag) {        /*         * here jsonobject data parsing         * , want set parsed value latlng order's object field         */          synchronized (order) {             switch (flag) {                 case 1:                     ordersfragment.getorderslist().get(ordersfragment.getorderslist().indexof(order)).setdeparturepoint(latlng);                     break;                 case 2:                     ordersfragment.getorderslist().get(ordersfragment.getorderslist().indexof(order)).setdestinationpoint(latlng);     /* tried      order.setdestinationpoint(latlng);*/                      break;             }          }      } 

but when check order's values when handlevolleyresponse finish working, new values isn't setting order's object.

ordersfragment.getorderslist() volatile

how can set field object ?


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -