Skip to content

Instantly share code, notes, and snippets.

@mohsenoid
Created April 26, 2020 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohsenoid/cfc723794972e50be51fd0d08aa5d2b0 to your computer and use it in GitHub Desktop.
Save mohsenoid/cfc723794972e50be51fd0d08aa5d2b0 to your computer and use it in GitHub Desktop.
CloseToMe - Observing Bluetooth State
closeToMe.isBluetoothEnabled.observe(this, Observer { isActive->
log("Bluetooth isActive: $isActive")
if (isActive == false) {
// start again
} else {
// do something
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment