发送自定义请求后,在发送文本请求出错

我先发送了一条custom信息,一切正常,当我在发送文本请求时就报错了

Process: top.yokey.shopnc, PID: 19360
    java.lang.ClassCastException: java.lang.Integer cannot be cast to jiguang.chat.adapter.ChattingListAdapter$ViewHolder
        at top.jiguang.chat.adapter.ChattingListAdapter.getView(ChattingListAdapter.java:584)
        at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
        at android.widget.AbsListView.obtainView(AbsListView.java:2346)
        at android.widget.ListView.makeAndAddView(ListView.java:1876)
        at android.widget.ListView.fillUp(ListView.java:736)
        at android.widget.ListView.layoutChildren(ListView.java:1666)
        at android.widget.AbsListView.onLayout(AbsListView.java:2148)
        at android.view.View.layout(View.java:16636)
        at android.view.ViewGroup.layout(ViewGroup.java:5437)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
        at android.view.View.layout(View.java:16636)
        at android.view.ViewGroup.layout(ViewGroup.java:5437)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
        at android.view.View.layout(View.java:16636)
        at android.view.ViewGroup.layout(ViewGroup.java:5437)
        at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
        at android.view.View.layout(View.java:16636)
        at android.view.ViewGroup.layout(ViewGroup.java:5437)
        at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
        at android.view.View.layout(View.java:16636)
        at android.view.ViewGroup.layout(ViewGroup.java:5437)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
        at android.view.View.layout(View.java:16636)
        at android.view.ViewGroup.layout(ViewGroup.java:5437)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
        at android.view.View.layout(View.java:16636)
        at android.view.ViewGroup.layout(ViewGroup.java:5437)
        at top.yokey.shopnc.chat.utils.swipeback.SwipeBackLayout.onLayout(SwipeBackLayout.java:390)
        at android.view.View.layout(View.java:16636)
        at android.view.ViewGroup.layout(ViewGroup.java:5437)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
        at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
        at android.view.View.layout(View.java:16636)
        at android.view.ViewGroup.layout(ViewGroup.java:5437)
        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2165)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1925)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6007)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
        at android.view.Choreographer.doCallbacks(Choreographer.java:670)
        at android.view.Choreographer.doFrame(Choreographer.java:606)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5539)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)

这个错误说明应该是你在不应该传 int 值的地方传了 int ,检查一下

@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final Message msg = mMsgList.get(position);
//消息接收方发送已读回执
if (msg.getDirect() == MessageDirect.receive && !msg.haveRead() && !isChatRoom) {
msg.setHaveRead(new BasicCallback() {
@Override
public void gotResult(int i, String s) {
}
});
}
final UserInfo userInfo = msg.getFromUser();
final ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = createViewByType(msg, position);
holder.msgTime = (TextView) convertView.findViewById(R.id.jmui_send_time_txt);
holder.headIcon = (ImageView) convertView.findViewById(R.id.jmui_avatar_iv);
holder.displayName = (TextView) convertView.findViewById(R.id.jmui_display_name_tv);
holder.txtContent = (TextView) convertView.findViewById(R.id.jmui_msg_content);
holder.sendingIv = (ImageView) convertView.findViewById(R.id.jmui_sending_iv);
holder.resend = (ImageButton) convertView.findViewById(R.id.jmui_fail_resend_ib);
holder.ivDocument = (ImageView) convertView.findViewById(R.id.iv_document);
holder.text_receipt = (TextView) convertView.findViewById(R.id.text_receipt);
switch (msg.getContentType()) {
case text:
holder.ll_businessCard = (LinearLayout) convertView.findViewById(R.id.ll_businessCard);
holder.business_head = (ImageView) convertView.findViewById(R.id.business_head);
holder.tv_nickUser = (TextView) convertView.findViewById(R.id.tv_nickUser);
holder.tv_userName = (TextView) convertView.findViewById(R.id.tv_userName);
break;
case image:
holder.picture = (ImageView) convertView.findViewById(R.id.jmui_picture_iv);
holder.progressTv = (TextView) convertView.findViewById(R.id.jmui_progress_tv);
break;
case file:
String extra = msg.getContent().getStringExtra(“video”);
if (!TextUtils.isEmpty(extra)) {
holder.picture = (ImageView) convertView.findViewById(R.id.jmui_picture_iv);
holder.progressTv = (TextView) convertView.findViewById(R.id.jmui_progress_tv);
holder.videoPlay = (LinearLayout) convertView.findViewById(R.id.message_item_video_play);
} else {
holder.progressTv = (TextView) convertView.findViewById(R.id.jmui_progress_tv);
holder.contentLl = (LinearLayout) convertView.findViewById(R.id.jmui_send_file_ll);
holder.sizeTv = (TextView) convertView.findViewById(R.id.jmui_send_file_size);
holder.alreadySend = (TextView) convertView.findViewById(R.id.file_already_send);
}
if (msg.getDirect().equals(MessageDirect.receive)) {
holder.fileLoad = (TextView) convertView.findViewById(R.id.jmui_send_file_load);
}
break;
case voice:
holder.voice = (ImageView) convertView.findViewById(R.id.jmui_voice_iv);
holder.voiceLength = (TextView) convertView.findViewById(R.id.jmui_voice_length_tv);
holder.readStatus = (ImageView) convertView.findViewById(R.id.jmui_read_status_iv);
break;
case location:
holder.location = (TextView) convertView.findViewById(R.id.jmui_loc_desc);
holder.picture = (ImageView) convertView.findViewById(R.id.jmui_picture_iv);
holder.locationView = convertView.findViewById(R.id.location_view);
break;
default:
holder.groupChange = (TextView) convertView.findViewById(R.id.jmui_group_content);
break;
}
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}

holder = (ViewHolder) convertView.getTag(); 这段直接报错了,