原文:https://blog.csdn.net/uyy203/article/details/72822414
private static boolean isWifi(Context mContext) {
ConnectivityManager connectivityManager = (ConnectivityManager) mContext
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo info= connectivityManager.getActiveNetworkInfo();
if (info!= null
&& info.getType() == ConnectivityManager.TYPE_WIFI) {
return true;
}
return false;
}
网友评论