Android Integrating Facebook - Getting FQL response in changed order -


i developing android application includes facebook integration. if execute multiple fql queries, getting response in changed order.

i using following code:

public static arraylist<string> photoalbumidarr = null;  @override public void oncreate(bundle savedinstancestate) {      setcontentview(r.layout.main);      photoalbumidarr = new arraylist<string>();      photoalbumidarr.add("111114545_25133454545");      photoalbumidarr.add("111114590_25133434768");      photoalbumidarr.add("111114232_2513345487");      photoalbumidarr.add("111114512_25133454456");      startprogress(); } public void startprogress() {     // long     photogalleryactivity.this.runonuithread(new runnable()  {         @override         public void run() {              string fqlquery = "";              for(int k=0;k<photoalbumidarr.size();k++)             {                 fqlquery = "select pid, src photo aid = '"+photoalbumidarr.get(k)+"'";                 bundle params = new bundle();                 params.putstring("q", fqlquery);                  session = session.getactivesession();                 request request = new request(session, "/fql", params,                         httpmethod.get, new request.callback() {                             public void oncompleted(response response) {                                 string jsonresponse = response.tostring();                                 log.i(log_tag, jsonresponse);                             }                         });                 request.executebatchasync(request);             }         }     }); } 

here callback response called after loop completed. in getting unorder response(i.e) getting first album photos last or middle response likewise. may problem. why unordered response.

this may due fact not have order clause in fql query.

try using like:

select pid, src photo aid = '{album id}' order modified

this ensure order returned same (assuming no images modified in-between queries).


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -