These are chat archives for Cardiff-University-Code-Academy/WBS

24th
Apr 2015
sreilly1
@sreilly1
Apr 24 2015 10:06
public boolean isOnline() {
ConnectivityManager cm =
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
return cm.getActiveNetworkInfo() != null &&
cm.getActiveNetworkInfo().isConnectedOrConnecting();
}
DJ
@djdavies
Apr 24 2015 10:15
cheers
apparently you don't want isConnectedOrConnecting(); you want isConnected();