Вопрос

I have 2 main AsyncTask which goal is to syncronize my app.

uploadFile and SyncData

So, if I have 3 pic to upload, I will have 3+1 = 4 threads

Each process fill a global error variable. So what I need is to get a way to run this method after all threads are done. How can I do it???

 for (Captura capt : lCapturassASync) {
        uploadFile(capt, ctx); // Is also an AsyncTask
    }
    new SyncData(ctx, lTiendasASync, lCapturassASync).execute("upload_datos", null);
Это было полезно?

Решение

Basically what you want to do is know when the async tasks were done in other threads. About doing it on java specifically you can read this it might give you a very good idea on how:

How to know if other threads have finished?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top