首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

运作runable阻塞线程

2012-08-30 
运行runable阻塞线程MyRun aa new MyRun ()new Thread(aa).start()//new Thread(aa).run() 会阻塞线

运行runable阻塞线程

MyRun aa = new MyRun ();new Thread(aa).start();//new Thread(aa).run(); 会阻塞线程

class MyRun implements Runnable{public void run() {try {Log.e("MyRun ","in");Thread.sleep(5000);Log.e("MyRun ", "out");} catch (InterruptedException e) {e.printStackTrace();}}}

热点排行