diff --git a/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java b/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java index 1cb782ce1..172771662 100644 --- a/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java @@ -5,12 +5,10 @@ import android.annotation.SuppressLint; import android.app.Dialog; import android.content.Intent; import android.content.pm.PackageManager; -import android.database.Cursor; import android.graphics.Color; import android.graphics.Outline; import android.net.Uri; import android.os.Build; -import android.provider.MediaStore; import android.util.SparseArray; import android.view.View; import android.view.ViewOutlineProvider; @@ -271,7 +269,7 @@ public class UserHomeActivity extends AbsActivity { tagList.add(userInfo.getUserHomeTopInfo().getAge() + (WordUtil.isNewZh() ? "歲" : "years old")); } if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getHeight())) { - tagList.add(userInfo.getUserHomeTopInfo().getHeight()+"cm"); + tagList.add(userInfo.getUserHomeTopInfo().getHeight() + "cm"); } if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCareer())) { tagList.add(userInfo.getUserHomeTopInfo().getCareer()); @@ -354,6 +352,9 @@ public class UserHomeActivity extends AbsActivity { public void onConfirmClick(Dialog dialog, String content) { bannerImgList.remove(position); uploadImg(false); + if (bannerImgList.isEmpty()) { + bannerImgList.add(userInfo.getUserHomeTopInfo().getUser_avatar()); + } } }); } @@ -761,6 +762,12 @@ public class UserHomeActivity extends AbsActivity { } private void uploadImg(boolean isUp) { + for (int i = 0; i < bannerImgList.size(); i++) { + if (bannerImgList.get(i).equals(userInfo.getUserHomeTopInfo().getUser_avatar())) { + bannerImgList.remove(i); + break; + } + } CommonHttpUtil.uploadUserInfoImg(new Gson().toJson(bannerImgList), new com.yunbao.common.http.HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) {