public class NetworkUtilImpl extends java.lang.Object implements NetworkUtil, NetworkEventProvider
NetworkUtil.NetworkStatus
NetworkEventProvider.Listener
DISCONNECTED, METERED, UNMETERED
Constructor and Description |
---|
NetworkUtilImpl(android.content.Context context) |
Modifier and Type | Method and Description |
---|---|
int |
getNetworkStatus(android.content.Context context)
Returns the current connection status.
|
void |
setListener(NetworkEventProvider.Listener listener) |
public int getNetworkStatus(android.content.Context context)
NetworkUtil
NetworkUtil.UNMETERED
if there is an internet connection or NetworkUtil.DISCONNECTED
if there is no
connection.getNetworkStatus
in interface NetworkUtil
context
- The application contextNetworkUtil.DISCONNECTED
,
NetworkUtil.METERED
or NetworkUtil.UNMETERED
.public void setListener(NetworkEventProvider.Listener listener)
setListener
in interface NetworkEventProvider