摘要 andriod提供了 Handler 和 Looper 来满足线程间的通信。例如一个子线程从网络上下载了一副图片,当它下载完成后会发送消息给主线程,这个消息是通过绑定在主线程的Handler来传递的。 正文 图解: 代码示例: /** * @author allin.dev * http://allin.cnblogs.com */ public class MainThread extends Activity { private static final String TAG = "MainThread"; private Handler mMainHandler, mChildHandler; private TextView info; private Button msgBtn; @Override public void onCreate( Bundle savedInstanceState ) { super.onCreate( savedInstanceState ); setContentView( R.layout.main ); info = (TextView) findViewById( R.id.info ); msgBtn = (Button) findViewById( R.id.msgBtn ); mMainHandler = new