Commit 5310ed4d authored by 张圣龙's avatar 张圣龙

add

parent 63bb8567
package com.zhimai.websocket.util
/**
* Explain:IOT socket
* Created on 2021/12/21.
* @author zhangshenglong
* 第一版只做socket ping,用于设备监听
*/
class MsgWebSocketIOTUtil {
}
\ No newline at end of file
...@@ -16,12 +16,11 @@ public class NetWorkUtils { ...@@ -16,12 +16,11 @@ public class NetWorkUtils {
if (cm == null) { if (cm == null) {
return false; return false;
} }
NetworkInfo networkInfo = cm.getActiveNetworkInfo(); try {
if (networkInfo != null) { return cm.getActiveNetworkInfo().isAvailable();
return networkInfo.isAvailable(); }catch (Exception e){
return false;
} }
return false;
} }
public static boolean isOffline(Context context) { public static boolean isOffline(Context context) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment