微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在Quick Blox android中无法获取用户的个人资料照片

如何解决在Quick Blox android中无法获取用户的个人资料照片

我正在使用快速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 举报,一经查实,本站将立刻删除。