Associating responses with specific requests using Loopj Android Asynchronous Http Client -


i'm using loopj android asynchronous http client send multiple http requests asynchronously.

i'm using static asynchttpclient suggested , sending multiple http posts , receiving responses on anonymous class. problem when request comes don't know how tie original request.

for instance, in caching situation, when send post , receive 200 ok need able know request response can mark sent.

try this:

public class myasynchttpresponsehandler extends asynchttpresponsehandler {      private string requestid;      public asynchttpresponsehandler(string requestid) {         this.requestid = requestid;     }      @override     public void onsuccess(string arg0)     {         super.onsuccess(arg0);         // use requestid here     } } 

sending request:

client.get(url, new myasynchttpresponsehandler(requestid)) 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -