mercredi 22 avril 2015

Sending two different requests to the AsyncTask at a same time

In one of my application i am checking the network changes by using Broadcast Receivers and communicating with the server in background and sending the Database records to the server by using an Async Task. This is working fine for me.

In the same way user can create the new records in the application and user can send the records by hitting 'done' in my app. Here also i am using the same AsyncTask which i used for the client-server interaction. Normally it is also working.

So, now i have a question like, if the user performing the Data sending action manually in the application at the same time my Background receiver calls means it will also send the data to server.

a) If we send the two different requests to the Asynctask at a same time is there any chance data miss matching b) In this case, how exactly the Asynctask will respond?
c) if it occurs is there any solution for it.

Hope you all get my question. or else i vll improve my question. Thank you

Aucun commentaire:

Enregistrer un commentaire