disk = ...; Observable<Data> network = ...; // Retrieve the first source with data Observable<Data> source = Observable .concat(memory, disk, network) .first();
force-disable the button Observable.combineLatest(emailChangeObservable, passwordChangeObservable,(emailObs, pwdObs) -> { boolean emailCheck = emailObs.text().length() >= 3; boolean passwordCheck = pwdObs.text().length() >= 3; return emailCheck && passwordCheck; }).subscribe(aBoolean -> { submitButton.setEnabled(aBoolean); }); // submit button will only be clickable if both forms have more than 3 characters each
force-disable the button Observable.combineLatest(emailChangeObservable, passwordChangeObservable,(emailObs, pwdObs) -> { boolean emailCheck = emailObs.text().length() >= 3; boolean passwordCheck = pwdObs.text().length() >= 3; return emailCheck && passwordCheck; }).subscribe(aBoolean -> { submitButton.setEnabled(aBoolean); }); // submit button will only be clickable if both forms have more than 3 characters each
force-disable the button Observable.combineLatest(emailChangeObservable, passwordChangeObservable,(emailObs, pwdObs) -> { boolean emailCheck = emailObs.text().length() >= 3; boolean passwordCheck = pwdObs.text().length() >= 3; return emailCheck && passwordCheck; }).subscribe(aBoolean -> { submitButton.setEnabled(aBoolean); }); // submit button will only be clickable if both forms have more than 3 characters each
force-disable the button Observable.combineLatest(emailChangeObservable, passwordChangeObservable,(emailObs, pwdObs) -> { boolean emailCheck = emailObs.text().length() >= 3; boolean passwordCheck = pwdObs.text().length() >= 3; return emailCheck && passwordCheck; }).subscribe(aBoolean -> { submitButton.setEnabled(aBoolean); }); // submit button will only be clickable if both forms have more than 3 characters each
force-disable the button Observable.combineLatest(emailChangeObservable, passwordChangeObservable,(emailObs, pwdObs) -> { boolean emailCheck = emailObs.text().length() >= 3; boolean passwordCheck = pwdObs.text().length() >= 3; return emailCheck && passwordCheck; }).subscribe(aBoolean -> { submitButton.setEnabled(aBoolean); }); // submit button will only be clickable if both forms have more than 3 characters each
force-disable the button Observable.combineLatest(emailChangeObservable, passwordChangeObservable,(emailObs, pwdObs) -> { boolean emailCheck = emailObs.text().length() >= 3; boolean passwordCheck = pwdObs.text().length() >= 3; return emailCheck && passwordCheck; }).subscribe(aBoolean -> { submitButton.setEnabled(aBoolean); }); // submit button will only be clickable if both forms have more than 3 characters each
force-disable the button Observable.combineLatest(emailChangeObservable, passwordChangeObservable,(emailObs, pwdObs) -> { boolean emailCheck = emailObs.text().length() >= 3; boolean passwordCheck = pwdObs.text().length() >= 3; return emailCheck && passwordCheck; }).subscribe(aBoolean -> { submitButton.setEnabled(aBoolean); }); // submit button will only be clickable if both forms have more than 3 characters each
before termination methods observable.finallyDo(action0); // after termination methods observable.doOnEach(action1); // next, completed or error observable.doOnRequest(action1);
handleUserPhoto(photo)); // ...When the Activity is being recreated... sub.unsubscribe(); // ...Once the Activity is recreated... request.subscribe(photo -> handleUserPhoto(photo));