@Override
    public void onReceive(Context context, Intent intent) {
      // TODO Auto-generated method stub
      Log.d("Session:", intent.getAction());
      if (ACTION_FRIENDED.equals(intent.getAction())) {
        initAdaperView();
      } else if (NotifyChatMessage.ACTION_NOTIFY_CHAT_MESSAGE.equals(intent.getAction())) {
        SessionList sessionList =
            (SessionList)
                intent.getSerializableExtra(NotifyChatMessage.EXTRAS_NOTIFY_SESSION_MESSAGE);
        if (sessionList == null) {
          return;
        }

        SessionVo tempSessionVo = new SessionVo();
        tempSessionVo.setSessionList(sessionList);
        List<SessionVo> sessionVos = adapter.getSessionVos();
        int index = sessionVos.indexOf(tempSessionVo);
        if (index != -1) {
          SessionVo mySessionVo = sessionVos.get(index);
          tempSessionVo.setCustomerVo(mySessionVo.getCustomerVo());
          sessionVos.remove(mySessionVo);
          sessionVos.add(index, tempSessionVo);
        } else {
          CustomerVo customerVo = getFinalDb().findById(sessionList.getFuid(), CustomerVo.class);
          if (customerVo != null) {
            tempSessionVo.setCustomerVo(customerVo);
            sessionVos.add(0, tempSessionVo);
          }
        }

        Collections.sort(sessionVos, mSessionComparator);

        handler.post(
            new Runnable() {

              @Override
              public void run() {
                adapter.notifyDataSetInvalidated();
                try {
                  // IndexTabActivity.getInstance()
                  // .sessionPromptUpdate();
                  getActivity().sendBroadcast(new Intent(IndexTabActivity.ACTION_REFRESH_SESSION));
                } catch (Exception e) {

                }
              }
            });
      }
    }
    private void bindViewHolder(ViewHolder viewHolder, SessionVo sessionVo) {
      if ("1".equals(sessionVo.getCustomerVo().getSex())) {
        viewHolder.imgSex.setImageResource(R.drawable.sex_man);
      } else {
        viewHolder.imgSex.setImageResource(R.drawable.sex_woman);
      }

      String userType = sessionVo.getCustomerVo().getCustomertype();
      if (Constants.CustomerType.CHATTING.equals(userType)) {
        // 认证头像
        if ("1".equals(sessionVo.getCustomerVo().getAgent())) {
          viewHolder.imgSubscript.setImageResource(R.drawable.subscript_economic);
          viewHolder.imgSubscript.setVisibility(View.VISIBLE);
        } else if ("1".equals(sessionVo.getCustomerVo().getHeadattest())) {
          viewHolder.imgSubscript.setImageResource(R.drawable.subscript_auth);
          viewHolder.imgSubscript.setVisibility(View.VISIBLE);
        } else {
          viewHolder.imgSubscript.setVisibility(View.GONE);
        }
      } else {
        // 是否是VIP
        if ("1".equals(sessionVo.getCustomerVo().getVip())) {
          viewHolder.imgSubscript.setImageResource(R.drawable.subscript_vip);
          viewHolder.imgSubscript.setVisibility(View.VISIBLE);
        } else {
          viewHolder.imgSubscript.setVisibility(View.GONE);
        }
      }

      long time = sessionVo.getSessionList().getUpdateTime();
      String userName = TextdescTool.getCustomerName(sessionVo.getCustomerVo());
      int noReadNum = sessionVo.getSessionList().getNotReadNum();

      String age = sessionVo.getCustomerVo().getBirthday();
      String location = sessionVo.getCustomerVo().getLocal();
      String line = sessionVo.getCustomerVo().getOnline();
      // String sign = sessionVo.getCustomerVo().getInterest();

      viewHolder.txtUsername.setText(userName);
      viewHolder.txtLocation.setText(location);
      if (0 != noReadNum) {
        viewHolder.txtNoreadNum.setVisibility(View.VISIBLE);
        viewHolder.txtNoreadNum.setText(noReadNum + "");
      } else {
        viewHolder.txtNoreadNum.setVisibility(View.GONE);
      }

      if (isEdit) {
        viewHolder.txtTime.setVisibility(View.GONE);
        viewHolder.btnDel.setVisibility(View.VISIBLE);
        viewHolder.btnDel.setOnClickListener(onClickListener);
        viewHolder.btnDel.setTag(sessionVo);
      } else {
        viewHolder.btnDel.setVisibility(View.GONE);
        viewHolder.txtTime.setVisibility(View.VISIBLE);
        viewHolder.txtTime.setText(TextdescTool.timeDifference(time));
      }
      // by zj
      viewHolder.txtAge.setText(TextdescTool.dateToAge(age, true) + "岁");
      viewHolder.txtLocation.setText(location);
      viewHolder.txtLine.setText(line);
      // by zj
      viewHolder.txtWealth.setText(
          getString(R.string.wealth_value) + sessionVo.getCustomerVo().getUsercp());

      FinalOnloadBitmap.finalDisplay(
          context, sessionVo.getCustomerVo(), viewHolder.imgHead, getHeadBitmap());
      viewHolder.imgHead.setTag(sessionVo.getCustomerVo());
      viewHolder.imgHead.setOnClickListener(onClickListener);
      if (!TextUtils.isEmpty(sessionVo.getSessionList().getLastContent()))
        viewHolder.txtSign.setText(
            EmojiUtil.getExpressionString(
                context, sessionVo.getSessionList().getLastContent(), ChatMainActivity.EMOJIREX));
    }