Created
September 23, 2016 15:56
-
-
Save fobidlim/0d2e017c1834920a092446387021604b to your computer and use it in GitHub Desktop.
RxActivity receive Rx event
This file contains 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
public class ReceiveActivity extends RxActivity { | |
private static final String TAG = "ReceiveActivity"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
RxEvent.getInstance() | |
.getObservable() | |
.compose(bindToLifecycle()) | |
.subscribe( | |
object -> Log.d(TAG, "onCreate: onNext()"), | |
error -> Log.d(TAG, "onCreate: onError()"), | |
() -> Log.d(TAG, "onCreate: onCompleted()") | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment