Merge pull request #16 from TouchInstinct/feature/network_connected_method

add isNetworkConnected() method
This commit is contained in:
Gavriil 2017-01-10 15:36:49 +03:00 committed by GitHub
commit cf3a9944d5
1 changed files with 10 additions and 0 deletions

View File

@ -180,6 +180,16 @@ public final class DeviceUtils {
}
/**
* Detects if some network connected.
*
* @param context Application context
* @return true if network connected, false otherwise.
*/
public static boolean isNetworkConnected(@NonNull final Context context) {
return getNetworkType(context) != NetworkType.NONE;
}
private DeviceUtils() {
}