observe
fun observe(context: Context, capabilities: List<Int> = listOf(NetworkCapabilities.NET_CAPABILITY_INTERNET), transportTypes: List<Int> = listOf(
NetworkCapabilities.TRANSPORT_WIFI,
NetworkCapabilities.TRANSPORT_CELLULAR
))
If your app have multiple process , make sure to call this one only on the main one only (UI)