Stay organized with collections
Save and categorize content based on your preferences.
OverlayManager
open class OverlayManager
OverlayManager gives apps the ability to create an OverlayManagerTransaction
to maintain the overlays and list the registered fabricated runtime resources overlays(FRROs).
OverlayManager returns the list of overlays to the app calling getOverlayInfosForTarget(java.lang.String)
. The app starts an OverlayManagerTransaction
to manage the overlays. The app can achieve the following by using OverlayManagerTransaction
.
Summary
Public methods |
open Unit |
Commit the overlay manager transaction.
|
open MutableList<OverlayInfo!> |
Get the related information of self-targeting overlays for targetPackageName .
|
Public methods
commit
open fun commit(transaction: OverlayManagerTransaction): Unit
Commit the overlay manager transaction.
Applications can register overlays and unregister the registered overlays in an atomic operation via OverlayManagerTransaction
.
Parameters |
transaction |
OverlayManagerTransaction: the series of overlay related requests to perform This value cannot be null . |
Exceptions |
java.lang.Exception |
if not all the requests could be successfully |
getOverlayInfosForTarget
open fun getOverlayInfosForTarget(targetPackageName: String): MutableList<OverlayInfo!>
Get the related information of self-targeting overlays for targetPackageName
.
Parameters |
targetPackageName |
String: the target package name This value cannot be null . |
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,["# OverlayManager\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOverlayManager\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/content/om/OverlayManager \"View this page in Java\") \n\n```\nopen class OverlayManager\n```\n\n|---|----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.content.om.OverlayManager](#) |\n\nOverlayManager gives apps the ability to create an [OverlayManagerTransaction](/reference/kotlin/android/content/om/OverlayManagerTransaction) to maintain the overlays and list the registered fabricated runtime resources overlays(FRROs).\n\nOverlayManager returns the list of overlays to the app calling [getOverlayInfosForTarget(java.lang.String)](#getOverlayInfosForTarget(kotlin.String)). The app starts an [OverlayManagerTransaction](/reference/kotlin/android/content/om/OverlayManagerTransaction) to manage the overlays. The app can achieve the following by using [OverlayManagerTransaction](/reference/kotlin/android/content/om/OverlayManagerTransaction).\n\n- register overlays\n- unregister overlays\n- execute multiple operations in one commitment by calling [commit(android.content.om.OverlayManagerTransaction)](#commit(android.content.om.OverlayManagerTransaction))\n\nSummary\n-------\n\n| Public methods ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [commit](#commit(android.content.om.OverlayManagerTransaction))`(`transaction:` `[OverlayManagerTransaction](/reference/kotlin/android/content/om/OverlayManagerTransaction)`)` Commit the overlay manager transaction. |\n| open [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[OverlayInfo](/reference/kotlin/android/content/om/OverlayInfo)!\\\u003e | [getOverlayInfosForTarget](#getOverlayInfosForTarget(kotlin.String))`(`targetPackageName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Get the related information of self-targeting overlays for `targetPackageName`. |\n\nPublic methods\n--------------\n\n### commit\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun commit(transaction: OverlayManagerTransaction): Unit\n```\n\nCommit the overlay manager transaction.\n\nApplications can register overlays and unregister the registered overlays in an atomic operation via [OverlayManagerTransaction](/reference/kotlin/android/content/om/OverlayManagerTransaction).\n\n| Parameters ||\n|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `transaction` | [OverlayManagerTransaction](/reference/kotlin/android/content/om/OverlayManagerTransaction): the series of overlay related requests to perform This value cannot be `null`. |\n\n| Exceptions ||\n|-----------------------|-----------------------------------------------|\n| `java.lang.Exception` | if not all the requests could be successfully |\n\n**See Also**\n\n- [android.content.om.OverlayManagerTransaction](/reference/kotlin/android/content/om/OverlayManagerTransaction) \n\n### getOverlayInfosForTarget\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getOverlayInfosForTarget(targetPackageName: String): MutableList\u003cOverlayInfo!\u003e\n```\n\nGet the related information of self-targeting overlays for `targetPackageName`.\n\n| Parameters ||\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| `targetPackageName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): the target package name This value cannot be `null`. |\n\n| Return ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|\n| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[OverlayInfo](/reference/kotlin/android/content/om/OverlayInfo)!\u003e | a list of overlay information This value cannot be `null`. |"]]