Package android.net
Class ConnectivityManager.NetworkCallback
- java.lang.Object
-
- android.net.ConnectivityManager.NetworkCallback
-
- Direct Known Subclasses:
OnNetworkStateChanged,SimpleNetworkCallbackAdapter
- Enclosing class:
- ConnectivityManager
public static class ConnectivityManager.NetworkCallback extends Object
Base class for NetworkRequest callbacks. Used for notifications about network changes. Should be extended by applications wanting notifications.
-
-
Constructor Summary
Constructors Constructor Description NetworkCallback()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonAvailable(Network network)Called when the framework connects and has declared new network ready for use.voidonCapabilitiesChanged(Network network, NetworkCapabilities networkCapabilities)Called when the network the framework connected to for this request changes capabilities but still satisfies the stated need.voidonLost(Network network)Called when the framework has a hard loss of the network or when the graceful failure ends.
-
-
-
Method Detail
-
onAvailable
public void onAvailable(Network network)
Called when the framework connects and has declared new network ready for use. This callback may be called more than once if theNetworkthat is satisfying the request changes.- Parameters:
network- TheNetworkof the satisfying network.
-
onCapabilitiesChanged
public void onCapabilitiesChanged(Network network, NetworkCapabilities networkCapabilities)
Called when the network the framework connected to for this request changes capabilities but still satisfies the stated need.- Parameters:
network- TheNetworkof the satisfying network.networkCapabilities- NetworkCapabilities: The newNetworkCapabilitiesfor this network.
-
-