@Deprecated public class NetworkConnectivityListener extends Object
Modifier and Type | Class and Description |
---|---|
static class |
NetworkConnectivityListener.State
Deprecated.
|
Constructor and Description |
---|
NetworkConnectivityListener()
Deprecated.
Create a new NetworkConnectivityListener.
|
Modifier and Type | Method and Description |
---|---|
NetworkInfo |
getNetworkInfo()
Deprecated.
Return the NetworkInfo associated with the most recent connectivity event.
|
NetworkInfo |
getOtherNetworkInfo()
Deprecated.
If the most recent connectivity event was a DISCONNECT, return
any information supplied in the broadcast about an alternate
network that might be available.
|
String |
getReason()
Deprecated.
An optional reason for the connectivity state change may have been supplied.
|
NetworkConnectivityListener.State |
getState()
Deprecated.
|
boolean |
isFailover()
Deprecated.
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.
|
void |
registerHandler(Handler target,
int what)
Deprecated.
This methods registers a Handler to be called back onto with the specified what code when
the network connectivity state changes.
|
void |
startListening(Context context)
Deprecated.
This method starts listening for network connectivity state changes.
|
void |
stopListening()
Deprecated.
This method stops this class from listening for network changes.
|
void |
unregisterHandler(Handler target)
Deprecated.
This methods unregisters the specified Handler.
|
public NetworkConnectivityListener()
public void startListening(Context context)
context
- public void stopListening()
public void registerHandler(Handler target, int what)
target
- The target handler.what
- The what code to be used when posting a message to the handler.public void unregisterHandler(Handler target)
target
- public NetworkConnectivityListener.State getState()
public NetworkInfo getNetworkInfo()
NetworkInfo
for the network that had the most recent connectivity event.public NetworkInfo getOtherNetworkInfo()
public boolean isFailover()
true
if this was a failover attempt, false
otherwise.public String getReason()
null
otherwise.