package com.swago.baseswago.util

import android.content.Context
import android.net.ConnectivityManager

/**
 *@date 2021/8/1 11:12
 *description:
 */
object NetUtil {


    fun isNetAvailable(context: Context):Boolean{
        val manager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
        val info = manager.activeNetworkInfo
        if(info!=null){
            return info.isAvailable
        }
        return false

    }

}