Skip to content

Instantly share code, notes, and snippets.

@fobidlim
Created September 23, 2016 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fobidlim/0d2e017c1834920a092446387021604b to your computer and use it in GitHub Desktop.
Save fobidlim/0d2e017c1834920a092446387021604b to your computer and use it in GitHub Desktop.
RxActivity receive Rx event
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