为了发送和接收事件,我们首先需要一个Event对象。事件对象实际上是简单的POJO。
public class ArbitaryEvent{ public static final int TYPE_1 = 1; public static final int TYPE_2 = 2; private int eventType; public ArbitaryEvent(int eventType){ this.eventType= eventType; } public int getEventType(){ return eventType; } }