首页 > 其他 > 详细

24 handle

时间:2014-05-03 22:54:04      阅读:438      评论:0      收藏:0      [点我收藏+]

1 http://blog.csdn.net/dengxiayehu/article/details/6398648

       Handler mHandler = new Handler();

  1. Runnable workRunnable = new Runnable() {  
  2.         int counter = 0;  
  3.           
  4.         public void run() {  
  5.             if (counter++ < 1) {  
  6.                 Log.i(TAG, "workRunnable thread id = " +   
  7.                         Thread.currentThread().getId());  
  8.                 mHandler.postDelayed(workRunnable, DELAY_TIME);  
  9.             }  
  10.         }  

mHandler.postDelayed(workRunnable, DELAY_TIME); 

 mHandler.removeCallbacks(workRunnable);

handler将thread放入主线程,没有开辟新线程。

 

  

24 handle,布布扣,bubuko.com

24 handle

原文:http://www.cnblogs.com/cliffhuang/p/3705183.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!