Skip to Content

SAP Cloud Platform Android SDK

Hello,

I want to wait until the response returns so I do this :

boolean running = true;
 scpService.getDownloadSetAsync(query, downloads -> {
    running = false;
 }, e -> {
    running = false;
 });

 while (running) {
  try {
     Thread.sleep(1000);
} catch (InterruptedException e) {
     e.printStackTrace();
  }
}


and it works only with getAsync.

but when I do the same thing on createEntityAsync/updateEntityAsync/deleteEntityAsync response doesn’t return and system stuck in while loop.

I read on developers guide that:

By default, queries are executed in parallel on Async.THREAD_POOL_EXECUTOR while CUD requests are executed serially on AsyncTask.SERIAL_EXECUTOR. This behavior can be changed by passing in your own executor.

but I don’t know how can I change this behavior?

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer