add isNetworkConnected() method

This commit is contained in:
Arseniy Borisov 2017-01-10 15:34:37 +03:00
parent fbaf5adba6
commit b2e429b7a3
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() {
}