/**
* make true current connect service is wifi
* @param mContext
* @return
*/
private static boolean isWifi(Context mContext) {
ConnectivityManager connectivityManager = (ConnectivityManager) mContext
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo();
if (activeNetInfo != null
&& activeNetInfo.getType() == ConnectivityManager.TYPE_WIFI) {
return true;
}
return false;
}
转载地址:
http://blog.csdn.net/jianghuiquan/article/details/8784907
Android判断是否为wifi环境
最新推荐文章于 2024-09-26 16:25:32 发布