创建Quickblox聊天但createialog time geting nullpointer。
QBPrivateChatManager privateChatManager = QBChatService.getInstance().getPrivateChatManager();
privateChatManager.createDialog(sub_arr.get(position).getOccupentId(), new QBEntityCallbackImpl<QBDialog>() {
@Override
public void onSuccess(QBDialog dialog, Bundle args) {
Log.d("dialog1", dialog+"");
}
@Override
public void onError(List<String> errors) {
}
});
答案 0 :(得分:4)
如果你没有打电话
QBChatService.getInstance().login(qbUser);
然后下一行将返回null:
QBPrivateChatManager privateChatManager = QBChatService.getInstance().getPrivateChatManager();
所以正确的方法是登录聊天然后获取QBPrivateChatManager