public final class ConnectivityUtil extends Object
Modifier and Type | Method and Description |
---|---|
static void |
callCurrentState(ConnectivityManager manager,
ConnectivityManager.NetworkCallback callback)
Checks the manager state and call the callbacks depending on it.
|
static void |
registerAndCall(ConnectivityManager manager,
ConnectivityManager.NetworkCallback callback)
Registers the callback as a default network callback, then call the callback depending on the current state.
|
public static void callCurrentState(@NonNull ConnectivityManager manager, @NonNull ConnectivityManager.NetworkCallback callback)
manager
- the manager to use.callback
- the callback to use.public static void registerAndCall(@NonNull ConnectivityManager manager, @NonNull ConnectivityManager.NetworkCallback callback)
manager
- the manager to use.callback
- the callback to use.ConnectivityManager.registerDefaultNetworkCallback(NetworkCallback)
,
#callCurrentState(ConnectivityManager, NetworkCallback)