IntentService 新建线程的证明
摘要:
在Activity中,startService()创建IntentService的时候,通过打印线程id,得知当前线程是1// long id = Thread.currentThread().getId(); 在IntentService的默认构造函数中,打印线程id 仍然为1 在onHandleIntent()中打印id,发现id为96,说明在onHandleIntent()处理事件的时候,系统会自动开辟新的线程去处理,这就是IntentService的用处, All requests are handled on a single worker thread -- the... 阅读全文
posted @ 2014-02-18 17:53 小白说我是2B 阅读(352) 评论(0) 推荐(0) 编辑