public abstract class Event
extends java.util.EventObject
An event is defined with:
EventSource
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
APPLICATION_STATE_BACKGROUND
application is in background at the time of event
|
static int |
APPLICATION_STATE_FOREGROUND
application is running in foreground at the time of event
|
static int |
APPLICATION_STATE_NOT_RUNNING
application is not running and was started due to event
|
static int |
APPLICATION_STATE_UNKNOWN
application state unknown
|
Constructor and Description |
---|
Event(EventSource source,
Object payload)
Constructor - for events with application state unknown at the time of
event
|
Event(EventSource source,
Object payload,
int appState)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getApplicationState()
Returns the application state at the time of event.
|
String |
getPayload()
Get event payload as a string
|
Object |
getPayloadObject()
Get event payload object
|
public static final int APPLICATION_STATE_UNKNOWN
public static final int APPLICATION_STATE_NOT_RUNNING
public static final int APPLICATION_STATE_BACKGROUND
public static final int APPLICATION_STATE_FOREGROUND
public Event(EventSource source, Object payload, int appState)
source
- event sourcepayload
- event informationappState
- application state at the time of event. Can be one of the
following:
public Event(EventSource source, Object payload)
source
- event sourcepayload
- event informationpublic String getPayload()
public Object getPayloadObject()
public int getApplicationState()