Android 环信3.3.0 在哪保存聊天室聊天记录?
每次退出聊天室重新进都拿不到历史聊天记录,单聊不影响,有人知道在哪保存的吗?
以下代码msgCount 和Count都是0,
以下代码msgCount 和Count都是0,
protected void onConversationInit(){ conversation = EMClient.getInstance().chatManager().getConversation(toChatUsername, EaseCommonUtils.getConversationType(chatType), true); conversation.markAllMessagesAsRead(); // the number of messages loaded into conversation is getChatOptions().getNumberOfMessagesLoaded // you can change this number //加载到对话的消息数量 //你可以改变这个数字 final Listmsgs = conversation.getAllMessages(); int msgCount = msgs != null ? msgs.size() : 0; LogUtil.e("消息记录数==",msgCount+""); LogUtil.e("消息记录数Count==",conversation.getAllMsgCount()+""); LogUtil.e("消息记录数pagesize==",pagesize+""); if (msgCount < conversation.getAllMsgCount() && msgCount < pagesize) { String msgId = null; if (msgs != null && msgs.size() > 0) { msgId = msgs.get(0).getMsgId(); } conversation.loadMoreMsgFromDB(msgId, pagesize - msgCount); }else{ LogUtil.e("消息记录数==","不加载"); } }
没有找到相关结果
已邀请:
1 个回复
geri_yang