1.HandlerThread+Handler+Message
package com.bvin.study.message; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.os.Handler.Callback; import android.os.HandlerThread; import android.os.Message; public class MainActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); HandlerThread ht = new HandlerThread("HandlerThread"); ht.start(); Handler handler = new Handler(ht.getLooper(),new Callback(){ @Override public boolean handleMessage(Message msg) { // TODO Auto-generated method stub setTitle((String)msg.obj); return true; } }); Message msg = handler.obtainMessage(); msg.obj = "就是我"; msg.sendToTarget();//发送至生成嘴个消息的Handler } }