public static boolean isNetworkConnected(Context context){
  if (context == null) {
    return false;
  }
  ConnectivityManager cm=(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
  NetworkInfo networkInfo=cm.getActiveNetworkInfo();
  return (networkInfo != null && networkInfo.isConnected());
}

public static boolean isNetworkConnected ( Context context ) { if ( context == null ) { return false ; } ConnectivityManager cm = ( ConnectivityManager ) context . getSystemService ( Context . CONNECTIVITY_SERVICE ) ; NetworkInfo networkInfo = cm . getActiveNetworkInfo ( ) ; return ( networkInfo != null && networkInfo . isConnected ( ) ) ; }
checked the network connect status .
