code: public boolean isNetworkConnected() {
  		try {
  			if (connMan == null) {
  				connMan = (ConnectivityManager) context
  						.getSystemService(Context.CONNECTIVITY_SERVICE);
  			}
  
  			NetworkInfo niMobile = connMan.getNetworkInfo(TYPE_MOBILE);
  			NetworkInfo niWifi = connMan.getNetworkInfo(TYPE_WIFI);
  			NetworkInfo niMms = connMan.getNetworkInfo(TYPE_MOBILE_MMS);
  			NetworkInfo niSupl = connMan.getNetworkInfo(TYPE_MOBILE_SUPL);
  			NetworkInfo niDun = connMan.getNetworkInfo(TYPE_MOBILE_DUN);
  			NetworkInfo niHipri = connMan.getNetworkInfo(TYPE_MOBILE_HIPRI);
  			NetworkInfo niWimax = connMan.getNetworkInfo(TYPE_WIMAX);
  			NetworkInfo niBlueTooth = connMan.getNetworkInfo(TYPE_BLUETOOTH);
  			NetworkInfo niDummy = connMan.getNetworkInfo(TYPE_DUMMY);
  			NetworkInfo niEthernet = connMan.getNetworkInfo(TYPE_ETHERNET);
  
  			if ((niMobile != null && niMobile.isConnected())
  					|| (niWifi != null && niWifi.isConnected())
  					|| (niMms != null && niMms.isConnected())
  					|| (niSupl != null && niSupl.isConnected())
  					|| (niDun != null && niDun.isConnected())
  					|| (niHipri != null && niHipri.isConnected())
  					|| (niWimax != null && niWimax.isConnected())
  					|| (niBlueTooth != null && niBlueTooth.isConnected())
  					|| (niDummy != null && niDummy.isConnected())
  					|| (niEthernet != null && niEthernet.isConnected())) {
  				return true;
  			}
  
  			return false;
  		} catch (Exception e) {
  			Log.e(TAG,
  					"Exception during isMobileConnected(). - "
  							+ e.getLocalizedMessage());
  		}
  		return false;
  	}
docs: Tells if network is currently connected<br>
  Requires ACCESS_NETWORK_SATE, READ_PHONE_STATE permissions<br>
  
  @return true if connected; false otherwise