在MessageContentHolder.java中 设置了如下代码:
// 聊天界面设置头像和昵称
TIMUserProfile profile = TIMFriendshipManager.getInstance().queryUserProfile(msg.getFromUser());
if (profile == null) {
usernameText.setText(msg.getFromUser());
} else {
if (TextUtils.isEmpty(msg.getGroupNameCard())) {
usernameText.setText(!TextUtils.isEmpty(profile.getNickName()) ? profile.getNickName() : msg.getFromUser());
} else {
usernameText.setText(msg.getGroupNameCard());
}
if (!TextUtils.isEmpty(profile.getFaceUrl()) && !msg.isSelf()) {
List<Object> urllist = new ArrayList<>();
urllist.add(profile.getFaceUrl());
leftUserIcon.setIconUrls(urllist);
urllist.clear();
}
}
TIMUserProfile selfInfo = TIMFriendshipManager.getInstance().queryUserProfile(TIMManager.getInstance().getLoginUser());
if (selfInfo != null && msg.isSelf()) {
if (!TextUtils.isEmpty(selfInfo.getFaceUrl())) {
List<Object> urllist = new ArrayList<>();
urllist.add(selfInfo.getFaceUrl());
rightUserIcon.setIconUrls(urllist);
urllist.clear();
}
}
为什么还是没有头像,getFaceUrl是空的,但是有昵称。
在ConversationCommonHolder.java中设置了 如下代码:
if (conversation.getIconUrlList() != null) {
conversationIconView.setIconUrls(conversation.getIconUrlList());
}
为什么聊天列表页,也是只有昵称,没有头像。
是什么原因?