Partager via


VirtualDeviceManager.GetVirtualDevice(Int32) Method

Definition

Returns the details of the virtual device with the given ID, if any.

[Android.Runtime.Register("getVirtualDevice", "(I)Landroid/companion/virtual/VirtualDevice;", "", ApiSince=35)]
public Android.Companion.Virtual.VirtualDevice? GetVirtualDevice (int deviceId);
[<Android.Runtime.Register("getVirtualDevice", "(I)Landroid/companion/virtual/VirtualDevice;", "", ApiSince=35)>]
member this.GetVirtualDevice : int -> Android.Companion.Virtual.VirtualDevice

Parameters

deviceId
Int32

Returns

the virtual device with the requested ID, or null if no such device exists or it has already been closed.

Attributes

Remarks

Returns the details of the virtual device with the given ID, if any.

The returned object is a read-only representation of the virtual device that expose its properties.

Note that if the virtual device is closed and becomes invalid, the returned object will not be updated and may contain stale values. Use a VirtualDeviceListener for real time updates of the availability of virtual devices.

Java documentation for android.companion.virtual.VirtualDeviceManager.getVirtualDevice(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to