Android 判断当前网络是否为wifi网络
2013-10-18 18:29
344 查看
public static boolean isWifiActive(Context context) { Context context2 = context.getApplicationContext(); ConnectivityManager manager = (ConnectivityManager) context2 .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo[] info; if (manager != null) { info = manager.getAllNetworkInfo(); if (info != null) { for (int i = 0; i < info.length; i++) { if ("WIFI".equals(info[i].getTypeName()) && info[i].isConnected()) { return true; } } } } return false; }
相关文章推荐
- android 判断当前网络是否可用(ping网络),包含wifi和移动数据网络
- Android检测网络状态,判断当前网络是否可用
- Android判断当前网络是否可用(数据流量是否连通)
- [置顶] Android开发之java代码工具类。判断当前网络是否连接并请求下载图片
- Android检测网络状态,判断当前网络是否可用
- 安卓学习笔记---Android检测网络状态,判断当前网络是否可用
- Android中判断当前网络是否可用
- Android 用ping的方法判断当前网络是否可用
- Android开发之判断网络(wifi、3G)是否连接
- Android开发之java代码工具类。判断当前网络是否连接并请求下载图片
- 【Android】使用ConnectivityManager与NetworkInfo实现判断当前网络环境是否可用
- 判断android手机当前是否接入网络
- Android检测网络状态,判断当前网络是否可用
- 判断当前网络是否可用和调用系统设置wifi界面
- 判断当前网络是否是wifi
- Android 判断当前网络状态是不是WiFi
- android 程序中判断当前是否连接网络,网络是否可用
- Android判断当前手机是否在wifi环境下
- Android 判断是否为Wifi网络
- Android检测网络状态,判断当前网络是否可用