问题描述
我正在使用快速blox进行聊天,但工作正常,但无法获取用户的个人资料照片 获取配置文件时,它给出空指针异常,我的代码在下面
Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
final QBUser user = new QBUser();
user.setId(qbChatDialogs.get(position).getoccupants().get(1));
Log.e("TAG","onBindViewHolder: " + user);
Log.e("TAG","onBindViewHolder: " + qbChatDialogs.get(position).getoccupants().get(1));
int userAvatarID = user.getFileId();// here is exception.////////////
QBContent.downloadFileById(userAvatarID,new QBProgressCallback() {
@Override
public void onProgressUpdate(int i) {
// do something to show progress if needed
}
}).performAsync(new QBEntityCallback<InputStream>() {
@Override
public void onSuccess(InputStream inputStream,Bundle bundle) {
Log.e("TAG","onSuccess: " + inputStream + " " + bundle);
// Receiving input stream
// Just write an InputStream to a file and show it
}
@Override
public void onError(QBResponseException e) {
Log.e("TAG","onError: " + e.getMessage());
}
});
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)