public boolean isNetworkConnected(){
  ConnectivityManager connectivityManager=(ConnectivityManager)getSystemService(CONNECTIVITY_SERVICE);
  NetworkInfo networkInfo=connectivityManager.getActiveNetworkInfo();
  return networkInfo != null && networkInfo.isConnectedOrConnecting();
}

public boolean isNetworkConnected ( ) { ConnectivityManager connectivityManager = ( ConnectivityManager ) getSystemService ( CONNECTIVITY_SERVICE ) ; NetworkInfo networkInfo = connectivityManager . getActiveNetworkInfo ( ) ; return networkInfo != null && networkInfo . isConnectedOrConnecting ( ) ; }
check the current active network is available .
