Answer the question
In order to leave comments, you need to log in
How to deal with a bunch of issynchronous requests in Retrofit 2?
I'm trying to implement synchronization of the database: - first I
load the elements of the first level, then as each element of the first level is loaded, I load the elements of the second and so queries can be launched ad infinitum. How to queue all this so that the application does not crash? I rummaged on the off site, even empty (or I don’t know how to search correctly) I also tried to look here - without results.
Answer the question
In order to leave comments, you need to log in
Use ExecutorService
public class MyService extends Service {
final String LOG_TAG = "myLogs";
ExecutorService es;
public void onCreate() {
super.onCreate();
Log.d(LOG_TAG, "MyService onCreate");
es = Executors.newFixedThreadPool(2);
}
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question