Stay organized with collections
Save and categorize content based on your preferences.
Event
abstract class Event
Abstract class for metrics events.
Summary
Public methods |
open Bundle |
Gets metrics-related information that is not supported by dedicated methods.
|
open Long |
Gets time since the corresponding log session is created in millisecond.
|
Public methods
getMetricsBundle
open fun getMetricsBundle(): Bundle
Gets metrics-related information that is not supported by dedicated methods.
It is intended to be used for backwards compatibility by the metrics infrastructure.
Return |
Bundle |
This value cannot be null . |
getTimeSinceCreatedMillis
open fun getTimeSinceCreatedMillis(): Long
Gets time since the corresponding log session is created in millisecond.
Return |
Long |
the timestamp since the instance is created, or -1 if unknown. Value is -1 or greater |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Event\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nEvent\n=====\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/metrics/Event \"View this page in Java\") \n\n```\nabstract class Event\n```\n\n|---|----------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.metrics.Event](#) |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [EditingEndedEvent](/reference/kotlin/android/media/metrics/EditingEndedEvent), [NetworkEvent](/reference/kotlin/android/media/metrics/NetworkEvent), [PlaybackErrorEvent](/reference/kotlin/android/media/metrics/PlaybackErrorEvent), [PlaybackStateEvent](/reference/kotlin/android/media/metrics/PlaybackStateEvent), [TrackChangeEvent](/reference/kotlin/android/media/metrics/TrackChangeEvent) |----------------------------------------------------------------------------------|----------------------------------------------| | [EditingEndedEvent](/reference/kotlin/android/media/metrics/EditingEndedEvent) | Event for an editing operation having ended. | | [NetworkEvent](/reference/kotlin/android/media/metrics/NetworkEvent) | Media network event. | | [PlaybackErrorEvent](/reference/kotlin/android/media/metrics/PlaybackErrorEvent) | Playback error event. | | [PlaybackStateEvent](/reference/kotlin/android/media/metrics/PlaybackStateEvent) | Playback state event. | | [TrackChangeEvent](/reference/kotlin/android/media/metrics/TrackChangeEvent) | Playback track change event. | |\n\nAbstract class for metrics events.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| open [Bundle](../../os/Bundle.html#) | [getMetricsBundle](#getMetricsBundle())`()` Gets metrics-related information that is not supported by dedicated methods. |\n| open [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getTimeSinceCreatedMillis](#getTimeSinceCreatedMillis())`()` Gets time since the corresponding log session is created in millisecond. |\n\nPublic methods\n--------------\n\n### getMetricsBundle\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getMetricsBundle(): Bundle\n```\n\nGets metrics-related information that is not supported by dedicated methods.\n\nIt is intended to be used for backwards compatibility by the metrics infrastructure.\n\n| Return ||\n|---------------------------------|------------------------------|\n| [Bundle](../../os/Bundle.html#) | This value cannot be `null`. |\n\n### getTimeSinceCreatedMillis\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getTimeSinceCreatedMillis(): Long\n```\n\nGets time since the corresponding log session is created in millisecond.\n\n| Return ||\n|------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | the timestamp since the instance is created, or -1 if unknown. Value is -1 or greater |\n\n**See Also**\n\n- [android.media.metrics.LogSessionId](/reference/kotlin/android/media/metrics/LogSessionId)\n- [android.media.metrics.PlaybackSession](/reference/kotlin/android/media/metrics/PlaybackSession)\n- [android.media.metrics.RecordingSession](/reference/kotlin/android/media/metrics/RecordingSession)"]]