鸟语天空
Activity.runOnUiThread()
post by:追风剑情 2015-1-24 12:37

从工作线程中更新UI需要用到此API

runOnUiThread(new Runnable()    
{    
            public void run()    
            {    
            	Context context = getApplicationContext();
            	CharSequence text = "Hello toast!";
            	int duration = Toast.LENGTH_LONG;
            	Toast toast = Toast.makeText(context, text, duration);
            	toast.show();
            }    
});    

评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容