代码如下,麻烦帮我看一下,谢谢
val conversation = Conversation(Conversation.ConversationType.Single, "102")
val remoteMsg = MutableLiveData<List<Message>>()
remoteMsg.observe(this) {
Log.e("嘿嘿哈哈", "onSuccess2999: " + it.size )
}
ChatManager.Instance().workHandler.post{
chatManager.getRemoteMessages(conversation, null, 0, 1000, object : GetRemoteMessageCallback{
override fun onSuccess(messages: MutableList<Message>) {
Log.e("嘿嘿哈哈", "onSuccess22: " + messages.size )
remoteMsg.value = messages
}
override fun onFail(errorCode: Int) {
remoteMsg.value = listOf()
Log.e("嘿嘿哈哈", "onSuccess11: " + errorCode )
}
})
}
val conversation1 = Conversation(Conversation.ConversationType.Single, "102", 0)
ChatManager.Instance()
.getUserMessages("6606", conversation1, 0, true, 20, object : GetMessageCallback {
override fun onSuccess(messages: List<Message>, hasMore: Boolean) {
Log.e("嘿嘿哈哈", "onSuccess999991: " + messages.size )
}
override fun onFail(errorCode: Int) {
}
})