Skip to content

Most visited

Recently visited

navigation

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 SHORTCUT_INVOCATION

An event type denoting that an action equivalent to a ShortcutInfo is taken by the user.

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.

String getShortcutId()

Returns the ID of a ShortcutInfo for this event if the event is of type SHORTCUT_INVOCATION, otherwise it returns null.

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)

SHORTCUT_INVOCATION

added in API level 25
int SHORTCUT_INVOCATION

An event type denoting that an action equivalent to a ShortcutInfo is taken by the user.

See also:

Constant Value: 8 (0x00000008)

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

getShortcutId

added in API level 25
String getShortcutId ()

Returns the ID of a ShortcutInfo for this event if the event is of type SHORTCUT_INVOCATION, otherwise it returns null.

Returns
String

See also:

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
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.