注册

[EaseUI問題] EaseConversationListFragment中,怎樣可以取得setContactsMap(getContacts())中getContacts()?

EaseConversationListFragment中,怎樣可以取得setContactsMap(getContacts())中getContacts()?
 
 联系人列表fragment

1.直接启动EaseConversationListFragment
示例:
 
conversationListFragment = new EaseConversationListFragment(); //需要设置联系人列表才能启动fragment contactListFragment.setContactsMap(getContacts()); //<---------------怎樣可以取得-getContacts--------------//设置item点击事件 contactListFragment.setContactListItemClickListener(new EaseContactListItemClickListener() {   @Override public void onListItemClicked(EaseUser user) { startActivity(new Intent(MainActivity.this, ChatActivity.class).putExtra(EaseConstant.EXTRA_USER_ID, user.getUsername())); } });
http://docs.easemob.com/doku.php?id=start:200androidcleintintegration:135easeuiuseguide
已邀请:
easeUI里面有实现方法,参考着来写,   /**
     * 临时生成的数据,密码皆为123456,可以登录测试接发消息
     * @Return
     */
    private Map<String, EaseUser> getContacts(){
        Map<String, EaseUser> contacts = new HashMap<String, EaseUser>();
        for(int i = 1; i <= 10; i++){
            EaseUser user = new EaseUser("easeuitest" + i);
            user.setAvatar(avatar);
            user.setNick(arg0);
            contacts.put("easeuitest" + i, user);
           
        }
        return contacts;
    }

要回复问题请先登录注册