Last active
April 29, 2018 16:14
-
-
Save tcw165/6a2b626263c27d11010d0a7b87e9e662 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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