UsageStatsManager.QueryEventsForSelf(Int64, Int64) Method

Definition

Like #queryEvents(long, long), but only returns events for the calling package.

[Android.Runtime.Register("queryEventsForSelf", "(JJ)Landroid/app/usage/UsageEvents;", "", ApiSince=28)]
public Android.App.Usage.UsageEvents? QueryEventsForSelf (long beginTime, long endTime);
[<Android.Runtime.Register("queryEventsForSelf", "(JJ)Landroid/app/usage/UsageEvents;", "", ApiSince=28)>]
member this.QueryEventsForSelf : int64 * int64 -> Android.App.Usage.UsageEvents

Parameters

beginTime
Int64

The inclusive beginning of the range of events to include in the results. Defined in terms of "Unix time", see java.lang.System#currentTimeMillis.

endTime
Int64

The exclusive end of the range of events to include in the results. Defined in terms of "Unix time", see java.lang.System#currentTimeMillis.

Returns

A UsageEvents object.

Attributes

Remarks

Like #queryEvents(long, long), but only returns events for the calling package. <em>Note: Starting from android.os.Build.VERSION_CODES#R Android R, if the user's device is not in an unlocked state (as defined by UserManager#isUserUnlocked()), then null will be returned.</em>

Java documentation for android.app.usage.UsageStatsManager.queryEventsForSelf(long, long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to