public class NetworkInfoReceiver
extends android.content.BroadcastReceiver
| Constructor and Description |
|---|
NetworkInfoReceiver(android.content.Context context)
Constructs a NetworkInfoReceive with a Context which is used to get the
system connectivity service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNetworkInfoListener(NetworkInfoChangeListener listener)
Adds a listener used to receive notification when network state changes.
|
boolean |
isNetworkConnected()
Gets Whether network is currently connected
|
void |
onReceive(android.content.Context context,
android.content.Intent intent) |
void |
removeNetworkInfoListener(NetworkInfoChangeListener listener)
Removes the given listener from the listener list.
|
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtraspublic NetworkInfoReceiver(android.content.Context context)
context - An Context object.public void addNetworkInfoListener(NetworkInfoChangeListener listener)
listener - A listener used to receive notification.public void removeNetworkInfoListener(NetworkInfoChangeListener listener)
listener - The listener to be removedpublic boolean isNetworkConnected()
public void onReceive(android.content.Context context,
android.content.Intent intent)
onReceive in class android.content.BroadcastReceiverCopyright © 2016. All rights reserved.