Package android.net

Class ConnectivityManager.NetworkCallback

    • Constructor Detail

      • NetworkCallback

        public NetworkCallback()
    • 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 the Network that is satisfying the request changes.
        Parameters:
        network - The Network of 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 - The Network of the satisfying network.
        networkCapabilities - NetworkCapabilities: The new NetworkCapabilities for this network.
      • onLost

        public void onLost​(Network network)
        Called when the framework has a hard loss of the network or when the graceful failure ends.
        Parameters:
        network - The Network lost.