question: public static boolean isNetworkConnected ( Context context ) { if ( null == context ) { return false ; } ConnectivityManager connectivityManager = ( ConnectivityManager ) context . getSystemService ( Context . CONNECTIVITY_SERVICE ) ; if ( connectivityManager != null ) { NetworkInfo info = connectivityManager . getActiveNetworkInfo ( ) ; if ( info != null && info . isConnected ( ) ) { if ( info . getState ( ) == NetworkInfo . State . CONNECTED ) { return true ; } } } return false ; }
target:  whether the network is connected