Skip to content

Instantly share code, notes, and snippets.

@tcw165
Last active April 29, 2018 16:14
Show Gist options
  • Select an option

  • Save tcw165/6a2b626263c27d11010d0a7b87e9e662 to your computer and use it in GitHub Desktop.

Select an option

Save tcw165/6a2b626263c27d11010d0a7b87e9e662 to your computer and use it in GitHub Desktop.
// Whatever Activity
private val mDisposables = CompositeDisposable()
private val mBtnFoo by lazy { findViewById<View>(R.id.foo) }
override fun onResume() {
mDisposables.add(
RxView.click(mBtnFoo)
.subscribe {
println("oh click on Foo")
})
}
override fun onPause() {
mDisposables.clear()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment