2011年10月24日

多线程(1)

摘要: java 编程思想-- 继承自Thread :package com.xtl.java;public class test extends Thread{ private int countDown = 6; private int threadCount = 0; private int threadNumber = ++threadCount; public test(int a ){ threadNumber = a; System.out.println("Making " + threadNumber ); } public void run(){ while(t 阅读全文

posted @ 2011-10-24 08:35 xtl 阅读(219) 评论(0) 推荐(0) 编辑

Android 的消息队列模型

摘要: Android 的消息队列模型 (转自 http://www.cnblogs.com/ghj1976/archive/2011/05/06/2038469.html)Android是参考Windows的消息循环机制来实现Android自身的消息循环的。 Android通过Looper、Handler来实现消息循环机制,Android消息循环是针对线程的(每个线程都可以有自己的消息队列和消息循环)。 Android系统中,Looper负责管理线程的消息队列和消息循环。我们可以通过Loop.myLooper()得到当前线程的Looper对象,通过Loop.getMainLooper()可以获得当前 阅读全文

posted @ 2011-10-24 08:34 xtl 阅读(194) 评论(0) 推荐(0) 编辑

导航