handler thread (mark)
public class MainActivity extends Activity {
Handler handler=new Handler();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
handler.post(run1);
}
Runnable run1=new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
System.out.println("你好!!");
handler.postDelayed(run1, 1000);
}
};
}
深入理解Android消息处理系统——Looper、Handler、Thread