When you have helper methods that return a Task object, you cannot use continueWith() or onSuccess() because the Bolts code will not treat it as a Task and wait for it to execute. He will consider Task as a simple data result.
In principle, this will not work, because the resulting task of this chain is Task<Task<Void>> :
update().onSuccess(new Continuation<ParseObject, Task<Void>>() { public Task<Void> then(Task<ParseObject> task) throws Exception { return Task.delay(3000); } })
But this will work, and the chain will return a Task<Void> :
update().onSuccessTask(new Continuation<ParseObject, Task<Void>>() { public Task<Void> then(Task<ParseObject> task) throws Exception { return Task.delay(3000); } })
source share