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