判断WIFI是否打开 @param context @return
(Context context)
| 40 | * @return |
| 41 | */ |
| 42 | public static boolean isWifiEnabled(Context context) { |
| 43 | ConnectivityManager mgrConn = (ConnectivityManager) context |
| 44 | .getSystemService(Context.CONNECTIVITY_SERVICE); |
| 45 | TelephonyManager mgrTel = (TelephonyManager) context |
| 46 | .getSystemService(Context.TELEPHONY_SERVICE); |
| 47 | return ((mgrConn.getActiveNetworkInfo() != null && mgrConn |
| 48 | .getActiveNetworkInfo().getState() == NetworkInfo.State.CONNECTED) || mgrTel |
| 49 | .getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * 判断是否是3G网络 |
nothing calls this directly
no outgoing calls
no test coverage detected