Closed amitkumarverma-android closed 6 years ago
My guess is that's because of wrong realization of AppApiHelper. It is created before first call is made while you don't have any credentials data, but it requires ApiHeader as a constructor parameter, which in it's turn requires both PublicApiHeader and ProtectedApiHeader. Since both of them are created before login call and both are singletons, ProtectedApiHeader lacks of credentials data, so second request will fail
Hi, I have make server call after another server api call it return exception on second api response in same presenter.
Message-java.lang.NullPointerException: value == null
value == null
And My Code is
@Override public void onServerLoginClick(String email, String password) { //validate email and password if (TextUtils.isEmpty(email)) { getMvpView().onError(R.string.empty_email); return; } if (!CommonUtils.isEmailValid(email)) { getMvpView().onError(R.string.invalid_email); return; } if (TextUtils.isEmpty(password)) { getMvpView().onError(R.string.empty_password); return; } getMvpView().showLoading();
After this call I call metthod fetchUserDetails()
@Override public void fetchUserDetails() { getDataManager().doUserDetailsApiCall() .subscribeOn(getSchedulerProvider().io()) .observeOn(getSchedulerProvider().ui()) .subscribe(new Consumer() {
@Override
public void accept(UserDetailResponse response) throws Exception {