Ok, but what happens if I need a Runnable that modifies/updates some parts of the GUI? wouldn't this cause problems if the operation doesn't run in the UI Thread?

El 12/07/11 13:37, Greg Brown escribió:
Ah ok, I get it now, I thougth wrapping the TaskListener with a TaskAdapter 
caused the actual task to be executed in the UI thread, since the listener is 
needed for the task to run in the background. It was a bit difficult to 
actually understand how Tasks work, I believe it'll be more intuitive to allow 
tasks to be executed async without actually adding a listener (I don't really 
use it most of the times), perhaps by adding an extra argument to the 
Task#execute() method?
If you don't need the listener, you'd be better off just using a plain old 
Thread. Tasks are meant to be used for asynchronous operations with a defined 
result (you can think of them as asynchronous method calls).

Reply via email to