Partager via


WifiManager.WifiLock.Acquire Method

Definition

Locks the Wi-Fi radio on until #release is called.

[Android.Runtime.Register("acquire", "()V", "GetAcquireHandler")]
public virtual void Acquire ();
[<Android.Runtime.Register("acquire", "()V", "GetAcquireHandler")>]
abstract member Acquire : unit -> unit
override this.Acquire : unit -> unit
Attributes

Remarks

Locks the Wi-Fi radio on until #release is called.

If this WifiLock is reference-counted, each call to acquire will increment the reference count, and the radio will remain locked as long as the reference count is above zero.

If this WifiLock is not reference-counted, the first call to acquire will lock the radio, but subsequent calls will be ignored. Only one call to #release will be required, regardless of the number of times that acquire is called.

Java documentation for android.net.wifi.WifiManager.WifiLock.acquire().

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