/** * 有新消息进来,最近联系人界面更新 */ @Override protected void msgReceive(Notice notice) { for (ChartHisBean ch : inviteNotices) { if (ch.getFrom().equals(notice.getFrom())) { ch.setContent(notice.getContent()); ch.setNoticeTime(notice.getNoticeTime()); Integer x = ch.getNoticeSum() == null ? 0 : ch.getNoticeSum(); ch.setNoticeSum(x + 1); } } noticeAdapter.setNoticeList(inviteNotices); noticeAdapter.notifyDataSetChanged(); setPaoPao(); }
/** * 刷新当前的列表 */ private void refreshList() { /** 刷新好友列表 */ rGroups = ContacterManager.getGroups(XmppConnectionManager .getInstance().getConnection().getRoster()); for (String newGroupName : newNames) { MRosterGroup mg = new MRosterGroup(newGroupName, new ArrayList<User>()); rGroups.add(rGroups.size() - 1, mg); } expandAdapter.setContacter(rGroups); expandAdapter.notifyDataSetChanged(); /** 刷新最近联系人列表 */ inviteNotices = MessageManager.getInstance(this) .getRecentContactsWithLastMsg(); noticeAdapter.setNoticeList(inviteNotices); noticeAdapter.notifyDataSetChanged(); /** * 有新消息进来的气泡设置 */ setPaoPao(); }