diff --git a/fake_land/NetworkUtils.java b/fake_land/NetworkUtils.java index fb2c5c8..890c816 100644 --- a/fake_land/NetworkUtils.java +++ b/fake_land/NetworkUtils.java @@ -12,6 +12,7 @@ public class NetworkUtils { public static boolean isNetworkAvailable(Context c) { Context context = c.getApplicationContext(); // 获取手机所有连接管理对象(包括对wi-fi,net等连接的管理) + ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (connectivityManager == null) {