public class NetworkEventDispatcher extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
NetworkEventDispatcher()
Visible for testing.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(NetworkEventListener toAdd)
Registers a listener to be notified when network events occur.
|
static NetworkEventDispatcher |
getInstance()
Returns the shared
NetworkEventDispatcher instance. |
void |
onNetworkConfigurationChanged()
Notifies registered listeners of a network configuration change.
|
void |
removeListener(NetworkEventListener toRemove)
De-registers a listener previously added with
addListener(NetworkEventListener). |
protected NetworkEventDispatcher()
getInstance() instead.public static NetworkEventDispatcher getInstance()
NetworkEventDispatcher instance.public void addListener(NetworkEventListener toAdd)
removeListener(NetworkEventListener)public void removeListener(NetworkEventListener toRemove)
addListener(NetworkEventListener). If
the listener was not previously registered this is a no-op.public void onNetworkConfigurationChanged()