@ RequiresPermission ( Manifest . permission . ACCESS_NETWORK_STATE ) public static Observable < Connectivity > observeNetworkConnectivity ( final Context context , final NetworkObservingStrategy strategy ) { Preconditions . checkNotNull ( context , "context == null" ) ; Preconditions . checkNotNull ( strategy , "strategy == null" ) ; return strategy . observeNetworkConnectivity ( context ) ; }
Observes network connectivity . Information about network state type and typeName are contained in observed Connectivity object . Moreover allows you to define NetworkObservingStrategy .