Search in sources :

Example 6 with AVIMException

use of com.avos.avoscloud.im.v2.AVIMException in project ride-read-android by Ride-Read.

the class ChatSingleActivity method onResendMsg.

/**
     * 重新发送已经发送失败的消息
     */
@Subscribe(threadMode = MAIN)
public void onResendMsg(ImTypeMsgResendEvent event) {
    if (null != mImConversation && null != event) {
        if (AVIMMessage.AVIMMessageStatus.AVIMMessageStatusFailed == event.message.getMessageStatus() && mImConversation.getConversationId().equals(event.message.getConversationId())) {
            mImConversation.sendMessage(event.message, new AVIMConversationCallback() {

                @Override
                public void done(AVIMException e) {
                    mMsgAdapter.notifyDataSetChanged();
                }
            });
            mMsgAdapter.notifyDataSetChanged();
        }
    }
}
Also used : AVIMConversationCallback(com.avos.avoscloud.im.v2.callback.AVIMConversationCallback) AVIMException(com.avos.avoscloud.im.v2.AVIMException) Subscribe(org.greenrobot.eventbus.Subscribe)

Aggregations

AVIMException (com.avos.avoscloud.im.v2.AVIMException)6 AVIMConversationCallback (com.avos.avoscloud.im.v2.callback.AVIMConversationCallback)4 AVIMClient (com.avos.avoscloud.im.v2.AVIMClient)3 AVIMConversation (com.avos.avoscloud.im.v2.AVIMConversation)3 AVIMConversationQuery (com.avos.avoscloud.im.v2.AVIMConversationQuery)3 AVIMConversationCreatedCallback (com.avos.avoscloud.im.v2.callback.AVIMConversationCreatedCallback)3 AVIMConversationQueryCallback (com.avos.avoscloud.im.v2.callback.AVIMConversationQueryCallback)3 AVIMTextMessage (com.avos.avoscloud.im.v2.messages.AVIMTextMessage)3 HashMap (java.util.HashMap)3 Subscribe (org.greenrobot.eventbus.Subscribe)2 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 TextUtils (android.text.TextUtils)1 View (android.view.View)1 EditText (android.widget.EditText)1 BindView (butterknife.BindView)1 OnClick (butterknife.OnClick)1 AVIMMessage (com.avos.avoscloud.im.v2.AVIMMessage)1 AVIMMessagesQueryCallback (com.avos.avoscloud.im.v2.callback.AVIMMessagesQueryCallback)1