public class MarshmallowNetworkObservingStrategy extends java.lang.Object implements NetworkObservingStrategy
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
ERROR_MSG_NETWORK_CALLBACK |
protected static java.lang.String |
ERROR_MSG_RECEIVER |
| Constructor and Description |
|---|
MarshmallowNetworkObservingStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected android.content.BroadcastReceiver |
createIdleBroadcastReceiver() |
protected android.net.ConnectivityManager.NetworkCallback |
createNetworkCallback(android.content.Context context) |
protected boolean |
isIdleMode(android.content.Context context) |
<any> |
observeNetworkConnectivity(android.content.Context context)
Observes network connectivity
|
void |
onError(java.lang.String message,
java.lang.Exception exception)
Handles errors, which occurred during observing network connectivity
|
protected void |
onNext(Connectivity connectivity) |
protected void |
registerIdleReceiver(android.content.Context context) |
protected void |
tryToUnregisterCallback(android.net.ConnectivityManager manager) |
protected void |
tryToUnregisterReceiver(android.content.Context context) |
protected static final java.lang.String ERROR_MSG_NETWORK_CALLBACK
protected static final java.lang.String ERROR_MSG_RECEIVER
public <any> observeNetworkConnectivity(android.content.Context context)
NetworkObservingStrategyobserveNetworkConnectivity in interface NetworkObservingStrategycontext - of the Activity or an Applicationprotected void registerIdleReceiver(android.content.Context context)
protected android.content.BroadcastReceiver createIdleBroadcastReceiver()
protected boolean isIdleMode(android.content.Context context)
protected void tryToUnregisterCallback(android.net.ConnectivityManager manager)
protected void tryToUnregisterReceiver(android.content.Context context)
public void onError(java.lang.String message,
java.lang.Exception exception)
NetworkObservingStrategyonError in interface NetworkObservingStrategymessage - to be processedexception - which was thrownprotected android.net.ConnectivityManager.NetworkCallback createNetworkCallback(android.content.Context context)
protected void onNext(Connectivity connectivity)