-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
// Code is in Kotlin here
// variable which subscribe and unsubscribe
private var sendStateSubscription: Subscription? = null
verride fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
sendStateSubscription= RxNetwork.connectivityChanges(requireContext(), cm).subscribe(Action1 {
if(it)
//conected
else
//disconnected
})
}
override fun onDestroy() {
sendStateSubscription?.unsubscribe()
sendStateSubscription = null
super.onDestroy()
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels