Search in sources :

Example 1 with RefreshProfileEvent

use of com.rideread.rideread.common.event.RefreshProfileEvent in project ride-read-android by Ride-Read.

the class UserInfoActivity method saveCurInfo.

private void saveCurInfo() {
    UserInfo curInfo = new UserInfo(mFaceUrl, mNick, mCurSexIndex + 1, mLabels, mSignature, mSchool, mLocation, mHomeTown, mCareer);
    ApiUtils.update(curInfo, mBirthday, new BaseCallback<BaseModel<UserInfo>>() {

        @Override
        protected void onSuccess(BaseModel<UserInfo> model) throws Exception {
            UserInfo userInfo = model.getData();
            if (null != userInfo) {
                UserUtils.saveUserInfo(userInfo);
                finish();
                EventBus.getDefault().postSticky(new RefreshProfileEvent());
            }
        }
    });
}
Also used : BaseModel(com.rideread.rideread.function.net.retrofit.BaseModel) UserInfo(com.rideread.rideread.data.result.UserInfo) JSONException(org.json.JSONException) IOException(java.io.IOException) RefreshProfileEvent(com.rideread.rideread.common.event.RefreshProfileEvent)

Aggregations

RefreshProfileEvent (com.rideread.rideread.common.event.RefreshProfileEvent)1 UserInfo (com.rideread.rideread.data.result.UserInfo)1 BaseModel (com.rideread.rideread.function.net.retrofit.BaseModel)1 IOException (java.io.IOException)1 JSONException (org.json.JSONException)1