Created
March 4, 2019 03:16
-
-
Save vamsitallapudi/ee3806c15e427c31c4daf05d0317adc2 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.transform | |
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 = "MapOperator" | |
class MapOperatorActivity : AppCompatActivity() { | |
private lateinit var disposable: Disposable | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_map_operator) | |
val observable = | |
Observable.just(1,2,3,4,5) | |
.map { | |
it*10 | |
} | |
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