0

I´m new with Android and I need any advice about Asyntask topic. Currently I´ve a app that I write some information and using AsyncTask I send to SAP System (BackEnd) using HttpURLConnection. I´m going to write a second Asyntask to send a photo using FTP protocol to another server.

So I´ve going to have two Asyntask one for the data with SAP and another with a ftp server to send a photo.

I have a listview with several lines of information, for each row I want use the first Asyntask and if it´s OK, I will use the second Asyntask.

When the first row was processed (with OK or wrong finish), the I want start with the first Asyntask and the second Asyntask and go on...

So How can I do it ????

Somethin like this:

http://shamansir.github.io/blog/articles/10-useful-solutions-for-android-developer/

(point 9. AsyncTask Queues )

http://blogs.innovationm.com/multiple-asynctask-in-android/

Can I chain async task sequentially (starting one after the previous asynctask completes)

Any advice ????

Thansk in advance

1 Answers1

0

You can call another asynctask from onPostExecute. It will be called after the first one has finished, and the call will be made from ui thread.

Alphaone
  • 570
  • 5
  • 6