Created
January 18, 2019 03:06
-
-
Save vamsitallapudi/4e60dfb684b771771e31d3b4264d3c13 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
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 = "FromOperatorActivity" | |
class FromOperatorActivity : AppCompatActivity() { | |
private lateinit var mDisposable : Disposable | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_from_operator) | |
val numList = arrayListOf(11,12,13,14,15) | |
val numObservable = Observable.fromIterable(numList) | |
mDisposable = numObservable.subscribe { | |
Log.d(TAG, it.toString()) | |
} | |
} | |
override fun onDestroy() { | |
mDisposable.dispose() | |
super.onDestroy() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment