Class Overview
类概述
Defines a message containing a description and arbitrary data object that can be sent to a Handler
. This object contains two extra int fields and an extra object field that allow you to not do allocations in many cases.
定义了一个包含一个描述和任意数据对象,可以被发送到Handler的消息。此对象包含两个额外的整型域和一个额外的对象字段允许您在许多情况下不做分配。
While the constructor of Message is public, the best way to get one of these is to call Message.obtain()
or one of the Handler.obtainMessage()
methods, which will pull them from a pool of recycled objects.
当消息的构造函数是公共的,得到一个最好的方法是调用Message.obtain()
或一个Handler.obtainMessage()方法,这将把他们从一个回收对象池回收。