Udostępnij za pośrednictwem


MtpDevice.Open(UsbDeviceConnection) Method

Definition

Opens the MTP device.

[Android.Runtime.Register("open", "(Landroid/hardware/usb/UsbDeviceConnection;)Z", "")]
public bool Open (Android.Hardware.Usb.UsbDeviceConnection connection);
[<Android.Runtime.Register("open", "(Landroid/hardware/usb/UsbDeviceConnection;)Z", "")>]
member this.Open : Android.Hardware.Usb.UsbDeviceConnection -> bool

Parameters

connection
UsbDeviceConnection

an open android.hardware.usb.UsbDeviceConnection for the device

Returns

true if the device was successfully opened.

Attributes

Remarks

Opens the MTP device. Once the device is open it takes ownership of the android.hardware.usb.UsbDeviceConnection. The connection will be closed when you call #close() The connection will also be closed if this method fails.

Java documentation for android.mtp.MtpDevice.open(android.hardware.usb.UsbDeviceConnection).

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