Created
August 13, 2018 07:53
-
-
Save vicky7230/9709e17565a7291a6fdd528f1c135582 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
commonApiService.sendOtp(phone) | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(login -> { | |
if (!isViewAttached()) { | |
return; | |
} | |
getMvpView().hideLoading(); | |
if (login != null && login.getSuccess() != null) { | |
if (login.getSuccess()) { | |
getMvpView().showMessage(login.getMessage()); | |
getMvpView().launchVerifyOtpActivityWithPhone(); | |
} else { | |
getMvpView().showError(login.getMessage()); | |
} | |
} | |
}, throwable -> { | |
if (!isViewAttached()) { | |
return; | |
} | |
getMvpView().hideLoading(); | |
Timber.e(throwable); | |
getMvpView().showError(throwable.getMessage()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment