Stay organized with collections
Save and categorize content based on your preferences.
VirtualDeviceManager.VirtualDeviceListener
public
static
interface
VirtualDeviceManager.VirtualDeviceListener
android.companion.virtual.VirtualDeviceManager.VirtualDeviceListener
|
Listener for changes in the available virtual devices.
Summary
Public methods |
default
void
|
onVirtualDeviceClosed(int deviceId)
Called whenever a virtual device has been removed from the system.
|
default
void
|
onVirtualDeviceCreated(int deviceId)
Called whenever a new virtual device has been added to the system.
|
Public methods
onVirtualDeviceClosed
public void onVirtualDeviceClosed (int deviceId)
Called whenever a virtual device has been removed from the system.
Parameters |
deviceId |
int : The id of the virtual device that was removed. |
onVirtualDeviceCreated
public void onVirtualDeviceCreated (int deviceId)
Called whenever a new virtual device has been added to the system.
Use VirtualDeviceManager.getVirtualDevice(int)
to get more information about
the device.
Parameters |
deviceId |
int : The id of the virtual device that was added. |
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,["# VirtualDeviceManager.VirtualDeviceListener\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nVirtualDeviceManager.VirtualDeviceListener\n==========================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/companion/virtual/VirtualDeviceManager.VirtualDeviceListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nVirtualDeviceManager.VirtualDeviceListener\n`\n\n\n`\n\n\n`\n\n|----------------------------------------------------------------------|\n| android.companion.virtual.VirtualDeviceManager.VirtualDeviceListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nListener for changes in the available virtual devices. \n**See also:**\n\n- [VirtualDeviceManager.registerVirtualDeviceListener(Executor, VirtualDeviceListener)](/reference/android/companion/virtual/VirtualDeviceManager#registerVirtualDeviceListener(java.util.concurrent.Executor,%20android.companion.virtual.VirtualDeviceManager.VirtualDeviceListener))\n\nSummary\n-------\n\n| ### Public methods ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` default void` | ` `[onVirtualDeviceClosed](/reference/android/companion/virtual/VirtualDeviceManager.VirtualDeviceListener#onVirtualDeviceClosed(int))`(int deviceId) ` Called whenever a virtual device has been removed from the system. |\n| ` default void` | ` `[onVirtualDeviceCreated](/reference/android/companion/virtual/VirtualDeviceManager.VirtualDeviceListener#onVirtualDeviceCreated(int))`(int deviceId) ` Called whenever a new virtual device has been added to the system. |\n\nPublic methods\n--------------\n\n### onVirtualDeviceClosed\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onVirtualDeviceClosed (int deviceId)\n```\n\nCalled whenever a virtual device has been removed from the system.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------------------------------------------------------|\n| `deviceId` | `int`: The id of the virtual device that was removed. \u003cbr /\u003e |\n\n### onVirtualDeviceCreated\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onVirtualDeviceCreated (int deviceId)\n```\n\nCalled whenever a new virtual device has been added to the system.\nUse [VirtualDeviceManager.getVirtualDevice(int)](/reference/android/companion/virtual/VirtualDeviceManager#getVirtualDevice(int)) to get more information about\nthe device.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|------------------------------------------------------------|\n| `deviceId` | `int`: The id of the virtual device that was added. \u003cbr /\u003e |"]]