override fun onReceive(context: Context, intent: Intent) { val con = context.getSystemService(ConnectivityManager::class.java) listener(con.activeNetworkInfo) } }
override fun onReceive(context: Context, intent: Intent) { val con = context.getSystemService(ConnectivityManager::class.java) listener(con.activeNetworkInfo) } }
override fun onReceive(context: Context, intent: Intent) { val con = context.getSystemService(ConnectivityManager::class.java) listener(con.activeNetworkInfo) } }
currentCats = _cat.value ?: return val updatedCats = currentCats.toMutableList() .map { old -> if(old.id == new.id) new else old } _cat.postValue(updatedCats) // update storage and web service ... }
currentCats = _cat.value ?: return val updatedCats = currentCats.toMutableList() .map { old -> if(old.id == new.id) new else old } _cat.postValue(updatedCats) // update storage and web service ... }
currentCats = _cat.value ?: return val updatedCats = currentCats.toMutableList() .map { old -> if(old.id == new.id) new else old } _cat.postValue(updatedCats) // update storage and web service ... }