Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package com.coderefer.rxandroidexamples.intro.operators.create
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.coderefer.rxandroidexamples.R
import io.reactivex.Observable
import io.reactivex.disposables.Disposable
private const val TAG = "JustOperPassList"
class JustOperPassingListActivity : AppCompatActivity() {
private lateinit var disposable: Disposable
val list = listOf("a", "b", "c", "d")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_just_oper_passing_list)
val observable = Observable.just(list)
disposable = observable.subscribe {
Log.d(TAG, it.toString())
}
}
override fun onDestroy() {
disposable.dispose()
super.onDestroy()
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.