Dela via


IWatchKey.Cancel Method

Definition

Cancels the registration with the watch service.

[Android.Runtime.Register("cancel", "()V", "GetCancelHandler:Java.Nio.FileNio.IWatchKeyInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public void Cancel ();
[<Android.Runtime.Register("cancel", "()V", "GetCancelHandler:Java.Nio.FileNio.IWatchKeyInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member Cancel : unit -> unit
Attributes

Remarks

Cancels the registration with the watch service. Upon return the watch key will be invalid. If the watch key is enqueued, waiting to be retrieved from the watch service, then it will remain in the queue until it is removed. Pending events, if any, remain pending and may be retrieved by invoking the #pollEvents pollEvents method after the key is cancelled.

If this watch key has already been cancelled then invoking this method has no effect. Once cancelled, a watch key remains forever invalid.

Java documentation for java.nio.file.WatchKey.cancel().

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