Stay organized with collections
Save and categorize content based on your preferences.
VisibleActivityCallback
interface VisibleActivityCallback
Callback interface for receiving visible activity changes used for assistant usage.
Summary
Public methods |
open Unit |
Callback to inform that a visible activity has gone.
|
open Unit |
Callback to inform that an activity has become visible.
|
Public methods
onVisible
open fun onVisible(activityInfo: VisibleActivityInfo): Unit
Callback to inform that an activity has become visible.
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,["# VoiceInteractionSession.VisibleActivityCallback\n\nAdded in [API level 32](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nVisibleActivityCallback\n=======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/service/voice/VoiceInteractionSession.VisibleActivityCallback \"View this page in Java\") \n\n```\ninterface VisibleActivityCallback\n```\n\n|----------------------------------------------------------------------------|\n| [android.service.voice.VoiceInteractionSession.VisibleActivityCallback](#) |\n\nCallback interface for receiving visible activity changes used for assistant usage.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onInvisible](#onInvisible(android.service.voice.VoiceInteractionSession.ActivityId))`(`activityId:` `[VoiceInteractionSession.ActivityId](/reference/kotlin/android/service/voice/VoiceInteractionSession.ActivityId)`)` Callback to inform that a visible activity has gone. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onVisible](#onVisible(android.service.voice.VisibleActivityInfo))`(`activityInfo:` `[VisibleActivityInfo](/reference/kotlin/android/service/voice/VisibleActivityInfo)`)` Callback to inform that an activity has become visible. |\n\nPublic methods\n--------------\n\n### onInvisible\n\nAdded in [API level 32](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onInvisible(activityId: VoiceInteractionSession.ActivityId): Unit\n```\n\nCallback to inform that a visible activity has gone.\n\n| Parameters ||\n|--------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| `activityId` | [VoiceInteractionSession.ActivityId](/reference/kotlin/android/service/voice/VoiceInteractionSession.ActivityId): This value cannot be `null`. |\n\n### onVisible\n\nAdded in [API level 32](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onVisible(activityInfo: VisibleActivityInfo): Unit\n```\n\nCallback to inform that an activity has become visible.\n\n| Parameters ||\n|----------------|------------------------------------------------------------------------------------------------------------------|\n| `activityInfo` | [VisibleActivityInfo](/reference/kotlin/android/service/voice/VisibleActivityInfo): This value cannot be `null`. |"]]