网络判断工具类
class NetUtils {
companion object{
fun panduan(cont : Context): Boolean{
val cont = cont.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val info = cont.activeNetworkInfo
if (info != null){
return info.isAvailable
}
return false
}
}
}