Freigeben über


WifiManager.AllowAutojoinGlobal(Boolean) Method

Definition

Control whether the device will automatically search for and connect to Wi-Fi networks - auto-join Wi-Fi networks.

[Android.Runtime.Register("allowAutojoinGlobal", "(Z)V", "GetAllowAutojoinGlobal_ZHandler", ApiSince=33)]
public virtual void AllowAutojoinGlobal (bool allowAutojoin);
[<Android.Runtime.Register("allowAutojoinGlobal", "(Z)V", "GetAllowAutojoinGlobal_ZHandler", ApiSince=33)>]
abstract member AllowAutojoinGlobal : bool -> unit
override this.AllowAutojoinGlobal : bool -> unit

Parameters

allowAutojoin
Boolean

true to allow auto-join, false to disallow auto-join

        Available for DO/PO apps.
        Other apps require <code data-dev-comment-type="c">android.Manifest.permission#NETWORK_SETTINGS</code> or
        <code data-dev-comment-type="c">android.Manifest.permission#MANAGE_WIFI_NETWORK_SELECTION</code> permission.
Attributes

Remarks

Control whether the device will automatically search for and connect to Wi-Fi networks - auto-join Wi-Fi networks. Disabling this option will not impact manual connections - i.e. the user will still be able to manually select and connect to a Wi-Fi network. Disabling this option significantly impacts the device connectivity and is a restricted operation (see below for permissions). Note that disabling this operation will also disable connectivity initiated scanning operations.

Disabling the auto-join configuration is a temporary operation (with the exception of a DO/PO caller): it will be reset (to enabled) when the device reboots or the user toggles Wi-Fi off/on. When the caller is a DO/PO then toggling Wi-Fi will not reset the configuration. Additionally, if a DO/PO disables auto-join then it cannot be (re)enabled by a non-DO/PO caller.

Java documentation for android.net.wifi.WifiManager.allowAutojoinGlobal(boolean).

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