如何完成后另一个线程上运行一个线程 [英] how to run one thread after complete another thread

查看:121
本文介绍了如何完成后另一个线程上运行一个线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要运行两个线程 R1 R2 。首先启动 R1 R1 完成后,启动 R2 (仅完成后 R1 )。如何才能做到这一点,两个线程,一个又一个的?

I want to run two threads r1, and r2. First start the r1 and after completion of r1, start r2 (only after the completion r1). How can this be done, two threads, one after another?

推荐答案

我的回答这里有使用处理程序的例子。如果你想在运行线程之间执行一些UI更新,这种方法可能是有用的。

My answer here has an example using a Thread and a Handler. This method might be useful if you wanted to perform some UI updates in between the threads running.

这篇关于如何完成后另一个线程上运行一个线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆