
有没有内置的Android为此?
谢谢,
编辑:
工作=从数据库获取信息.完成后,使用获取的信息更新UI.
final static ExecutorService tpe = Executors.newSingleThreadExecutor();...tpe.submit(new Runnable() { @OverrIDe public voID run() { // your work }}): 它不是特定于AndroID的,它是jdk5的一部分.
来自doc:
总结Creates an Executor that uses a single worker thread operating off an unbounded queue. (Note however that if this single thread terminates due to a failure during execution prior to shutdown,a new one will take its place if needed to execute subsequent tasks.) Tasks are guaranteed to execute sequentially,and no more than one task will be active at any given time. Unlike the otherwise equivalent newFixedThreadPool(1) the returned executor is guaranteed not to be reconfigurable to use additional threads.
以上是内存溢出为你收集整理的Android线程队列全部内容,希望文章能够帮你解决Android线程队列所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)