diff --git a/src/main/java/ru/touchin/templates/DeviceUtils.java b/src/main/java/ru/touchin/templates/DeviceUtils.java index 33d228b..bb77c52 100644 --- a/src/main/java/ru/touchin/templates/DeviceUtils.java +++ b/src/main/java/ru/touchin/templates/DeviceUtils.java @@ -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() { }