ContactInfoCache cache = ContactInfoCache.getInstance();
Context context = getContext();
// Recipient
mRecipientView.setText(cache.getContactName(context, recipient));
// Status text
mStatusView.setText(cache.getContactName(context, status));
// Status icon
String receivedStr = context.getString(R.string.status_received);
String failedStr = context.getString(R.string.status_failed);
String pendingStr = context.getString(R.string.status_pending);
String rejectStr = context.getString(R.string.status_rejected);
if (status.compareTo(receivedStr) == 0) {
mIconView.setImageResource(R.drawable.ic_sms_mms_delivered);
} else if (status.compareTo(failedStr) == 0) {
mIconView.setImageResource(R.drawable.ic_sms_mms_not_delivered);
} else if (status.compareTo(pendingStr) == 0) {
mIconView.setImageResource(R.drawable.ic_sms_mms_pending);
} else if (status.compareTo(rejectStr) == 0) {
// FIXME: need replace ic_sms_mms_not_delivered by a rejected icon.
mIconView.setImageResource(R.drawable.ic_sms_mms_not_delivered);
} else {
// No status report or unknown
}