android - RequestBatch.Callback onBatchCompleted() not called -


having trouble using facebook graph api library android when sending batch of requests.

not getting callback when running code:

        requestbatch requestbatch = new requestbatch(requests);         requestbatch.addcallback(new com.facebook.requestbatch.callback() {             @override             public void onbatchcompleted(requestbatch batch) {                 log.e(log_tag, "onbatchcompleted()");             }         });         requestbatch.executeasync(); 

found answer.

you need set callback each individual request batch-related callback, because onbatchcompleted callback called after per-request callbacks called..

        (string friend : friends) {             mylog.d(log_tag, "adding request " + friend.getinterestfbid());             string graphpath = friend + "/feed";             request request = new request(session, graphpath, null, httpmethod.get);             bundle params = new bundle();             params.putstring("fields",                              "id,"+                              "name,"+                              "username,"+                              "feed,");             request.setparameters(params);               // vital or batch callback never arrive                         request.setcallback(new com.facebook.request.callback() {                 @override                 public void oncompleted(response response) {}             });               requests.add(request);          } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -