鸟语天空
android.os.Handler
post by:追风剑情 2015-1-25 0:56
Handler myHandler = new Handler() {
//此方法会在ui线程中执行
public void handleMessage(Message msg) {   
            	Context context = getApplicationContext();
            	CharSequence text = "Hello Handler! what="+msg.what;
            	int duration = Toast.LENGTH_LONG;
            	Toast.makeText(context, text, duration).show();
            }
};
       
Message msg = new Message();
msg.what = 1;
myHandler.dispatchMessage(msg);
评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容