转自:http://iaiai.iteye.com/blog/1992196 obtainmessage()是从消息池中拿来一个msg 不需要另开辟空间new new需要重新申请,效率低,obtianmessage可以循环利用: //use Handler.obtainMessage(),instead of msg = new Message(); //because if there is already an Message object,that not be used by //any…
在handler.obtainMessage()的参数是这样写的: Message android.os.Handler.obtainMessage(int what, int arg1, int arg2, Object obj) public final Message obtainMessage (int what, int arg1, int arg2, Object obj) Since: API Level 1 Same as obtainMessage(), except that…