You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shanti Ranjan Das edited this page Jul 11, 2020
·
1 revision
Usage
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")
})