-
Notifications
You must be signed in to change notification settings - Fork 0
NetworkObserver
Shanti Ranjan Das edited this page Jul 11, 2020
·
1 revision
This class is used for overserving network connection in android device and return true or false when a device is connected or disconnected from network. Application context is required.
val connection = NetworkObserver(this.applicationContext);
connection.observe(this, Observer {
if (it)
Log.d("Network","Connected")
else Log.d("Network","Disconnected")
})