MCPcopy Create free account
hub / github.com/Freelander/Android_Data / isWifi

Method isWifi

fake_land/NetworkUtils.java:73–82  ·  view source on GitHub ↗

判断是wifi还是3g网络 @param context @return

(Context context)

Source from the content-addressed store, hash-verified

71 * @return
72 */
73 public static boolean isWifi(Context context) {
74 ConnectivityManager cm = (ConnectivityManager) context
75 .getSystemService(Context.CONNECTIVITY_SERVICE);
76 NetworkInfo networkINfo = cm.getActiveNetworkInfo();
77 if (networkINfo != null
78 && networkINfo.getType() == ConnectivityManager.TYPE_WIFI) {
79 return true;
80 }
81 return false;
82 }
83}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected