Last active
July 25, 2017 00:36
-
-
Save keinix/3bb07d445163ad1ba5f125375bf0816b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean networkIsAvailable() { | |
ConnectivityManager manager = (ConnectivityManager) | |
getSystemService(Context.CONNECTIVITY_SERVICE); | |
NetworkInfo networkInfo = manager.getActiveNetworkInfo(); | |
boolean isAvailable = false; | |
if (networkInfo != null && networkInfo.isConnected()) { | |
isAvailable = true; | |
} | |
return isAvailable; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment