loops - Multiple AsyncTask Android -


i have specific annoying process on app. app needs retrieve server list of complex object "product". each product object contains id refers manufacturer id. process request list of products , each product need request on manufacturer id informations related it. thing use volley make requests. asynchronous method, i cannot make loop (which synchronous) request each manufacturer. i've read asynctask perform such process. means need execute asynctask each product retrieve manufacturer information.

i wanted know if there way manage because seems bad performance... if have 50 product, need make 50 asynctasks...

if don't need tasks in foreground when end, use threadpoolexecutor run requests using fixed amount of threads (as don't want start 50 threads).

if need know when have finished, can use synchronization tools java.util.concurrent package, cyclicbarrier or atomicinteger.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -