Most visited

Recently visited

Added in API level 21

UsageEvents.Event

public static final class UsageEvents.Event
extends Object

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


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.

int USER_INTERACTION

An event type denoting that a package was interacted with in some way by the user.

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.

Inherited methods

From class java.lang.Object

Constants

CONFIGURATION_CHANGE

Added in API level 21
int CONFIGURATION_CHANGE

An event type denoting that the device configuration has changed.

Constant Value: 5 (0x00000005)

MOVE_TO_BACKGROUND

Added in API level 21
int MOVE_TO_BACKGROUND

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

Constant Value: 2 (0x00000002)

MOVE_TO_FOREGROUND

Added in API level 21
int MOVE_TO_FOREGROUND

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

Constant Value: 1 (0x00000001)

NONE

Added in API level 21
int NONE

No event type.

Constant Value: 0 (0x00000000)

USER_INTERACTION

Added in API level 23
int USER_INTERACTION

An event type denoting that a package was interacted with in some way by the user.

Constant Value: 7 (0x00000007)

Public constructors

UsageEvents.Event

Added in API level 21
UsageEvents.Event ()

Public methods

getClassName

Added in API level 21
String getClassName ()

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

Returns
String

getConfiguration

Added in API level 21
Configuration getConfiguration ()

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

Returns
Configuration

getEventType

Added in API level 21
int getEventType ()

The event type. See MOVE_TO_BACKGROUND See MOVE_TO_FOREGROUND

Returns
int

getPackageName

Added in API level 21
String getPackageName ()

The package name of the source of this event.

Returns
String

getTimeStamp

Added in API level 21
long getTimeStamp ()

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

See currentTimeMillis().

Returns
long

Hooray!