@OnClick(R.id.submit_profile) void onSaveProfileClicked(final View v) { Timber.v("Attempting to save profile"); String firstName = firstNameEditText.getText().toString(); String lastName = lastNameEditText.getText().toString(); // String email = emailEditText.getText().toString(); UserSpec spec = new UserSpec(); final User user = new User(); user.getData().attributes().firstName(firstName); user.getData().attributes().lastName(lastName); user.getData().attributes().base64PhotoData(base64PhotoData); // user.getData().attributes().email(email); spec.create(new CreateUserRequest()); spec.update(user); userRepo .update(spec) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( new Action1<User>() { @Override public void call(User user) { Timber.v("Profile saved"); ProfileEditView view = getView(); if (view != null) { ToastService.get(view) .bern(view.getContext().getString(R.string.profile_saved)); FTBApplication.getEventBus().post(new LoginEvent(LoginEvent.LOGIN, user)); Flow.get(view.getContext()).set(new HomeScreen()); } else { Timber.w("getView() null, cannot notify user of successful profile save"); } } }, new Action1<Throwable>() { @Override public void call(Throwable throwable) { Timber.e(throwable, "Unable to save profile"); Crashlytics.logException(throwable); ProfileEditView view = getView(); if (view != null) { ToastService.get(view) .bern(view.getContext().getString(R.string.error_saving_profile)); } else { Timber.w("getView() null, cannot notify user of failed profile save"); } } }); }