Added in API level 21

UsageEvents


class UsageEvents : Parcelable
kotlin.Any
   ↳ android.app.usage.UsageEvents

A result returned from android.app.usage.UsageStatsManager#queryEvents(long, long) from which to read android.app.usage.UsageEvents.Event objects.

Summary

Nested classes

An event representing a state change for a component.

Inherited constants
Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Boolean

Retrieve the next android.app.usage.UsageEvents.Event from the collection and put the resulting data into eventOut.

Boolean

Returns whether or not there are more events to read using getNextEvent(android.app.usage.UsageEvents.Event).

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<UsageEvents!>

Public methods

describeContents

Added in API level 21
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getNextEvent

Added in API level 21
fun getNextEvent(eventOut: UsageEvents.Event!): Boolean

Retrieve the next android.app.usage.UsageEvents.Event from the collection and put the resulting data into eventOut.

Parameters
eventOut UsageEvents.Event!: The android.app.usage.UsageEvents.Event object that will receive the next event data.
Return
Boolean true if an event was available, false if there are no more events.

hasNextEvent

Added in API level 21
fun hasNextEvent(): Boolean

Returns whether or not there are more events to read using getNextEvent(android.app.usage.UsageEvents.Event).

Return
Boolean true if there are more events, false otherwise.

writeToParcel

Added in API level 21
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.
This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

Added in API level 21
static val CREATOR: Parcelable.Creator<UsageEvents!>