bianhua

iApp判断设备是否有网络
使用教程将代码放在载入事件即可代码部分javanew(ct,"android.content.Conte...
扫描右侧二维码阅读全文
16
2019/09

iApp判断设备是否有网络

使用教程

将代码放在载入事件即可

代码部分

javanew(ct,"android.content.Context")
javags(cs,ct,"android.content.Context","CONNECTIVITY_SERVICE")
java(cm,activity,"android.app.Activity.getSystemService","String",cs)
java(nif,cm,"android.net.ConnectivityManager.getActiveNetworkInfo")
f(nif != null)
{
java(ss.rnink,nif,"android.net.NetworkInfo.isAvailable")
tw("有网络")
}
else
{
ss rnink = false
tw("无网络")
}
Last modification:September 23rd, 2019 at 11:16 pm
如果觉得我的文章对你有用,请随意赞赏

Leave a Comment