ConnectivityManager.StartUsingNetworkFeature(ConnectivityType, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Caution
deprecated
Tells the underlying networking system that the caller wants to begin using the named feature.
[Android.Runtime.Register("startUsingNetworkFeature", "(ILjava/lang/String;)I", "GetStartUsingNetworkFeature_ILjava_lang_String_Handler")]
[System.Obsolete("deprecated")]
public virtual int StartUsingNetworkFeature (Android.Net.ConnectivityType networkType, string? feature);
[<Android.Runtime.Register("startUsingNetworkFeature", "(ILjava/lang/String;)I", "GetStartUsingNetworkFeature_ILjava_lang_String_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member StartUsingNetworkFeature : Android.Net.ConnectivityType * string -> int
override this.StartUsingNetworkFeature : Android.Net.ConnectivityType * string -> int
Parameters
- networkType
- ConnectivityType
specifies which network the request pertains to
- feature
- String
the name of the feature to be used
Returns
an integer value representing the outcome of the request.
The interpretation of this value is specific to each networking
implementation+feature combination, except that the value -1
always indicates failure.
- Attributes
Remarks
Tells the underlying networking system that the caller wants to begin using the named feature. The interpretation of feature
is completely up to each networking implementation.
This method requires the caller to hold either the android.Manifest.permission#CHANGE_NETWORK_STATE
permission or the ability to modify system settings as determined by android.provider.Settings.System#canWrite
.
This member is deprecated. Deprecated in favor of the cleaner #requestNetwork(NetworkRequest, NetworkCallback)
API. In VERSION_CODES#M
, and above, this method is unsupported and will throw UnsupportedOperationException
if called.
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.