Added in API level 35

VirtualDeviceListener


interface VirtualDeviceListener
android.companion.virtual.VirtualDeviceManager.VirtualDeviceListener

Listener for changes in the available virtual devices.

Summary

Public methods
open Unit

Called whenever a virtual device has been removed from the system.

open Unit

Called whenever a new virtual device has been added to the system.

Public methods

onVirtualDeviceClosed

Added in API level 35
open fun onVirtualDeviceClosed(deviceId: Int): Unit

Called whenever a virtual device has been removed from the system.

Parameters
deviceId Int: The id of the virtual device that was removed.

onVirtualDeviceCreated

Added in API level 35
open fun onVirtualDeviceCreated(deviceId: Int): Unit

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.