Search code examples
androidasynchronoustaskbolts-framework

Bolts framework continueWith does not finish code execution


I have Task, that fetches results from server. While storing that data to database in bolt's .continueWith It got interrupted with something "completedImmediately" (found while debugging cycle).

 this.someMethod.getStatements()
        .continueWith(new Continuation<List<Statement>, Object>() {
          @Override public Object then(Task<List<Statement>> task) {

            for (Statement statement : task.getResult()) {
              saveStatement(statement);
            }

            return null;
          }
        });

Solution

  • Found solution, there was a problem in inner method, which was storing data to database.