http://developer.android.com/reference/java/util/concurrent/FutureTask.html
A cancellable asynchronous computation. This class provides a base implementation ofFuture, with methods to start and cancel a computation, query to see if the computation is complete, and retrieve the result of the computation. The result can only be retrieved when the computation has completed; the get method will block if the computation has not yet completed. Once the computation has completed, the computation cannot be restarted or cancelled.
A FutureTask can be used to wrap a Callable orRunnable object. BecauseFutureTask implements Runnable, a FutureTask can be submitted to anExecutor for execution.
In addition to serving as a standalone class, this class provides protected functionality that may be useful when creating customized task classes.
这个类在 android.os.AsyncTask中被使用。
详解Android中AsyncTask的使用
http://blog.youkuaiyun.com/liuhe688/article/details/6532519
现在就先写这些,以后有心情了再写详细些。

本文介绍了Android中FutureTask类的使用方式及其作为取消异步计算的基础实现。此外还探讨了如何利用FutureTask来包装Callable或Runnable对象,并通过Executor执行。最后提到了Android.os.AsyncTask中FutureTask的应用。
2568

被折叠的 条评论
为什么被折叠?



