possible work around for some weird - possibly sdk - bugs

This commit is contained in:
iNPUTmice 2014-12-07 21:14:13 +01:00
parent 8616a62b3a
commit 490f40b196

View file

@ -343,7 +343,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
final Message message = getItem(position); final Message message = getItem(position);
final Conversation conversation = message.getConversation(); final Conversation conversation = message.getConversation();
final Account account = conversation.getAccount(); final Account account = conversation.getAccount();
int type = getItemViewType(position); final int type = getItemViewType(position);
ViewHolder viewHolder; ViewHolder viewHolder;
if (view == null) { if (view == null) {
viewHolder = new ViewHolder(); viewHolder = new ViewHolder();
@ -371,7 +371,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
.findViewById(R.id.message_time); .findViewById(R.id.message_time);
viewHolder.indicatorReceived = (ImageView) view viewHolder.indicatorReceived = (ImageView) view
.findViewById(R.id.indicator_received); .findViewById(R.id.indicator_received);
view.setTag(viewHolder);
break; break;
case RECEIVED: case RECEIVED:
view = activity.getLayoutInflater().inflate( view = activity.getLayoutInflater().inflate(
@ -392,21 +391,23 @@ public class MessageAdapter extends ArrayAdapter<Message> {
.findViewById(R.id.message_time); .findViewById(R.id.message_time);
viewHolder.indicatorReceived = (ImageView) view viewHolder.indicatorReceived = (ImageView) view
.findViewById(R.id.indicator_received); .findViewById(R.id.indicator_received);
view.setTag(viewHolder);
break; break;
case STATUS: case STATUS:
view = activity.getLayoutInflater().inflate( view = activity.getLayoutInflater().inflate(
R.layout.message_status, parent, false); R.layout.message_status, parent, false);
viewHolder.contact_picture = (ImageView) view viewHolder.contact_picture = (ImageView) view
.findViewById(R.id.message_photo); .findViewById(R.id.message_photo);
view.setTag(viewHolder);
break; break;
default: default:
viewHolder = null; viewHolder = null;
break; break;
} }
view.setTag(viewHolder);
} else { } else {
viewHolder = (ViewHolder) view.getTag(); viewHolder = (ViewHolder) view.getTag();
if (viewHolder == null) {
return view;
}
} }
if (type == STATUS) { if (type == STATUS) {