大家好我正在尝试使用Quickblox为Android制作视频通话应用。
然而,当我执行项目时,我在尝试获取用户列表时收到错误“404 Not found”。
private void initOpponentListAdapter() {
final ListView opponentsList = (ListView) view.findViewById(R.id.opponentsList);
List<QBUser> users = ((CallActivity) getActivity()).getOpponentsList();
QBPagedRequestBuilder requestBuilder = new QBPagedRequestBuilder();
requestBuilder.setPerPage(100);
if (users == null) {
List<String> tags = new LinkedList<String>();
tags.add("webrtcusers");
QBUsers.getUsersByTags(
tags, requestBuilder,
new QBEntityCallback<ArrayList<QBUser>>() {
@Override
public void onSuccess(ArrayList<QBUser> qbUsers, Bundle bundle) {
Log.d("Track", "download users from QickBlox");
ArrayList<QBUser> orderedUsers = reorderUsersByName(qbUsers);
if(isAdded()) {
((CallActivity) getActivity()).setOpponentsList(orderedUsers);
prepareUserList(opponentsList, orderedUsers);
progresDialog.dismiss();
} else {
Log.e("getActivity() error", "get Activity is null, because adapter wasn't added");
}
}
@Override
public void onSuccess() {
}
@Override
public void onError(List<String> strings) {
Log.d("Track", "onError()");
}
}
);
} else {
ArrayList<QBUser> userList = ((CallActivity) getActivity()).getOpponentsList();
prepareUserList(opponentsList, userList);
progresDialog.dismiss();
}
}
这是logcat的结果。
06-06 03:44:11.154: W/EGL_genymotion(3050): eglSurfaceAttrib not implemented
06-06 03:44:11.238: W/EGL_genymotion(3050): eglSurfaceAttrib not implemented
06-06 03:44:11.490: D/dalvikvm(3050): GC_FOR_ALLOC freed 306K, 9% free 4158K/4568K, paused 6ms, total 6ms
06-06 03:44:11.890: D/QBASDK(3050): *********************************************************
06-06 03:44:11.890: D/QBASDK(3050): *** RESPONSE *** ac58f201-a366-40c0-a6e7-22ea22b2dd41 ***
06-06 03:44:11.890: D/QBASDK(3050): STATUS : 404
06-06 03:44:11.890: D/QBASDK(3050): HEADERS
06-06 03:44:11.890: D/QBASDK(3050): Access-Control-Allow-Origin=*
06-06 03:44:11.890: D/QBASDK(3050): Cache-Control=no-cache
06-06 03:44:11.890: D/QBASDK(3050): Connection=keep-alive
06-06 03:44:11.890: D/QBASDK(3050): Content-Type=application/json; charset=utf-8
06-06 03:44:11.890: D/QBASDK(3050): Date=Sat, 06 Jun 2015 07:44:11 GMT
06-06 03:44:11.890: D/QBASDK(3050): QB-Token-ExpirationDate=2015-06-06 09:44:09 UTC
06-06 03:44:11.890: D/QBASDK(3050): QuickBlox-REST-API-Version=0.1.1
06-06 03:44:11.890: D/QBASDK(3050): Server=nginx/1.0.15
06-06 03:44:11.890: D/QBASDK(3050): Status=404 Not Found
06-06 03:44:11.890: D/QBASDK(3050): Transfer-Encoding=chunked
06-06 03:44:11.890: D/QBASDK(3050): X-Rack-Cache=miss
06-06 03:44:11.890: D/QBASDK(3050): X-Request-Id=4dde392fc0e70b3032595495dc3e4ebc
06-06 03:44:11.890: D/QBASDK(3050): X-Runtime=0.023759
06-06 03:44:11.890: D/QBASDK(3050): X-UA-Compatible=IE=Edge,chrome=1
06-06 03:44:11.890: D/QBASDK(3050): BODY
06-06 03:44:11.890: D/QBASDK(3050): ' '
06-06 03:44:11.890: D/Track(3050): onError()
请提出任何建议,谢谢。
答案 0 :(得分:0)
我解决了这个问题,我忘了向用户添加标签