摘要:
handler.post(r)其实这样并不会新起线程,只是执行的runnable里的run()方法,却没有执行start()方法,所以runnable走的还是UI线程。1.如果像这样,是可以操作ui,但是run还是走在主线程,见打印出来的Log线程名字是main,说明是主线程。这就是为什么可以直接在run方法里操作ui,因为它本质还是ui线程handler.post(new Runnable(){ public void run(){ Log.e("当前线程:",Thread.currrentThread.getName());//这里打印de结果会是main setTit 阅读全文
posted @ 2014-04-09 11:22
彭大叔
阅读(201)
评论(0)
推荐(0)