// check for wifi or 3g
ConnectivityManager mgrConn = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
TelephonyManager mgrTel = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
if ((mgrConn.getActiveNetworkInfo()!=null && mgrConn.getActiveNetworkInfo().getState()==NetworkInfo.State.CONNECTED)
|| mgrTel.getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS) {
...
检查网络wifi
原创mb649166f4c151e 博主文章分类:android ©著作权
©著作权归作者所有:来自51CTO博客作者mb649166f4c151e的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:这是webView内容大小
下一篇:得到状态栏高度
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Android Service检查Wifi状态并用notification通知
今天一到公司被接到一个新需求说要做一个监测Wifi连接状况的功能,纳闷要这功能何为的时候,突然领悟到公司那不多数,贴上代码:pub
android java 开发语言 wifi连接 ipad -
检查WIFI是否连接
查看网络连接 查看WiFi连接状态 (连接- -断开)
网络连接 wifi连接 编程 -
ios 判断网络是否连接 iphone怎么检查wifi是否有问题
我们经常会遇到手机显示已经连接了Wi-Fi,而且还是满格信号,密码也正确,也没有不良标志,但就是不能上网,一般出现这种情况的话,有几个地方可能出现问题导致的:手机、路由器、网络。 1.手机 首先进入手机的“设置”——“无线网络”里面查看“wifi状态”这一项是否显示“已连接上”,如果不是显示“已连接上”的话,你最好手动重新连接一下。选择自己家的wifi连接。如果不行就断开连接,
ios 判断网络是否连接 iphone连上wifi却上不了网 手机能上wifi电脑不行 苹果电脑怎么连接wifi IP