Android APIs
public static final class

UsageEvents.Event

extends Object
java.lang.Object
   ↳ android.app.usage.UsageEvents.Event

Class Overview

An event representing a state change for a component.

Summary

Constants
int CONFIGURATION_CHANGE An event type denoting that the device configuration has changed.
int MOVE_TO_BACKGROUND An event type denoting that a component moved to the background.
int MOVE_TO_FOREGROUND An event type denoting that a component moved to the foreground.
int NONE No event type.
Public Constructors
UsageEvents.Event()
Public Methods
String getClassName()
The class name of the source of this event.
Configuration getConfiguration()
Returns a Configuration for this event if the event is of type CONFIGURATION_CHANGE, otherwise it returns null.
int getEventType()
The event type.
String getPackageName()
The package name of the source of this event.
long getTimeStamp()
The time at which this event occurred, measured in milliseconds since the epoch.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int CONFIGURATION_CHANGE

Added in API level 21

An event type denoting that the device configuration has changed.

Constant Value: 5 (0x00000005)

public static final int MOVE_TO_BACKGROUND

Added in API level 21

An event type denoting that a component moved to the background.

Constant Value: 2 (0x00000002)

public static final int MOVE_TO_FOREGROUND

Added in API level 21

An event type denoting that a component moved to the foreground.

Constant Value: 1 (0x00000001)

public static final int NONE

Added in API level 21

No event type.

Constant Value: 0 (0x00000000)

Public Constructors

public UsageEvents.Event ()

Added in API level 21

Public Methods

public String getClassName ()

Added in API level 21

The class name of the source of this event. This may be null for certain events.

public Configuration getConfiguration ()

Added in API level 21

Returns a Configuration for this event if the event is of type CONFIGURATION_CHANGE, otherwise it returns null.

public int getEventType ()

Added in API level 21

The event type. See MOVE_TO_BACKGROUND See MOVE_TO_FOREGROUND

public String getPackageName ()

Added in API level 21

The package name of the source of this event.

public long getTimeStamp ()

Added in API level 21

The time at which this event occurred, measured in milliseconds since the epoch.

See currentTimeMillis().