@Override public void onClick(View v) { switch (v.getId()) { case R.id.title_iv_left: doBack(); break; case R.id.title_iv_more: showPopupWindow(title_iv_more, current_position); break; case R.id.rl_title_center: if (null != list && list.size() > 0) { showPopupWindow(rl_title_center); } else { UIHelper.ToastMessage(context, "您还没有添加宝宝信息"); // BabyInfoListActivity.this.finish(); // backAnim(); return; } break; case R.id.rl_myepei_babyinfo: if (babyInfoDetail != null) { Intent intent_babyinfodetail = new Intent(context, BabyInfoDetailActivity.class); intent_babyinfodetail.putExtra("babyInfoDetail", babyInfoDetail); startActivityForResult(intent_babyinfodetail, Constant.REQUSTCONDE_BABYINFO_CATLIST); intoAnim(); } break; case R.id.rl_myepei_personinfo_babyinfo_count: if (babyInfoDetail != null && babyInfoDetail.getOrgCount() != null && babyInfoDetail.getOrgCount() > 0) { Intent intent_babyinfoorg = new Intent(context, BabyinfoOrgListActivity.class); intent_babyinfoorg.putExtra("babyInfoDetail", babyInfoDetail); startActivityForResult(intent_babyinfoorg, Constant.REQUSTCONDE_BABYINFO_CATLIST); intoAnim(); } else { UIHelper.ToastMessage(context, "该宝宝未加入任何教育机构"); } break; default: break; } }
@Override protected void onPostExecute(BabyInfoDetail result) { // TODO Auto-generated method stub super.onPostExecute(result); closeProgressDialog(); if (null != result) { if (result.getStatus().equals("0")) { showPicture(result.getPhotoPath(), iv_myepei_personinfo_pic, options); tv_myepei_babyinfo_name.setText(result.getName()); tv_myepei_babyinfo_age.setText( TextUtils.isEmpty(result.getAge()) || result.getAge().equals("0") ? "" : result.getAge() + "岁"); if (result.getSex().equals("0")) { iv_myepei_babyinfo_sex.setImageResource(R.drawable.sex_female); } if (result.getSex().equals("1")) { iv_myepei_babyinfo_sex.setImageResource(R.drawable.sex_man); } tv_myepei_babyinfo_nickname.setText(result.getNickName()); tv_myepei_babyinfo_birthdate.setText(result.getBirthDate()); StringBuffer buffString = new StringBuffer(); for (InterestPri interestPri : babyInfoDetail.getInterestPriList()) { for (InterestSec interestSec : interestPri.getInterestSecList()) { buffString.append(interestSec.getItemName() + ","); } } String buffStr = buffString.toString(); if (buffStr.endsWith(",")) { buffStr = buffStr.substring(0, buffStr.length() - 1); } tv_myepei_babyinfo_cats.setText(buffStr); if (result.getOrgCount() != null && result.getOrgCount() > 0) { tv_myepei_babyinfo_count.setText("(" + result.getOrgCount() + ")"); } else { tv_myepei_babyinfo_count.setText(""); } } else { UIHelper.ToastMessage(context, result.getStatusMessage()); return; } } else { if (null != e) { e.makeToast(context); } return; } }