Skip to content

Instantly share code, notes, and snippets.

@CostaFot
Last active May 9, 2019 20:41
Show Gist options
  • Save CostaFot/9223c869299191f73e483774df58f44e to your computer and use it in GitHub Desktop.
Save CostaFot/9223c869299191f73e483774df58f44e to your computer and use it in GitHub Desktop.
private fun changeButtonText() {
compositeDisposableOnPause.add(
Single.fromCallable {generateString()}
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe { textGenerated -> button.text = textGenerated }
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment