public class NetworkStatusManager
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
NetworkStatusManager.State |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkIsWifi(android.content.Context context) |
static NetworkStatusManager |
getInstance() |
android.net.NetworkInfo |
getNetworkInfo()
Return the NetworkInfo associated with the most recent connectivity event.
|
android.net.NetworkInfo |
getOtherNetworkInfo()
If the most recent connectivity event was a DISCONNECT, return any information supplied in the broadcast about an alternate network that might be available.
|
java.lang.String |
getReason()
An optional reason for the connectivity state change may have been supplied.
|
static void |
init(android.content.Context context) |
boolean |
isFailover()
Returns true if the most recent event was for an attempt to switch over to a new network following loss of connectivity on another network.
|
boolean |
isWifi() |
void |
startListening(android.content.Context context)
This method starts listening for network connectivity state changes.
|
void |
stopListening()
This method stops this class from listening for network changes.
|
public static void init(android.content.Context context)
public static NetworkStatusManager getInstance()
public static boolean checkIsWifi(android.content.Context context)
public void startListening(android.content.Context context)
context - public void stopListening()
public android.net.NetworkInfo getNetworkInfo()
NetworkInfo for the network that had the most recent connectivity event.public android.net.NetworkInfo getOtherNetworkInfo()
public boolean isFailover()
true if this was a fail over attempt, false otherwise.public java.lang.String getReason()
null otherwise.public boolean isWifi()