@file:JvmName("NetWorkUtils")

package com.qimai.android.fetch.tool

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

/**
@author wangwei

@version 1.1.1
@date 2019-08-14
@Description
@email wangwei_5521@163.com
 **/
fun isNetworkConnected(context: Context): Boolean {
    val mConnectivityManager =
        context!!.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
    val mNetworkInfo = mConnectivityManager.activeNetworkInfo
    if (mNetworkInfo != null) {
        return mNetworkInfo.isAvailable
    }
    return false
}