requestBuilder.or("userPhone",myPhone,phoneList);
}
}
QBCustomObjects.getObjects("image", requestBuilder, new QBCallbackImpl() {
“phoneList”是字符串的arrayList。现在在我的设备上这段代码运行良好,但在三星设备上我崩溃了:“java.lang.IllegalArgumentException: Illegal character in query at index 147: https://api.quickblox.com/data/image ..”
现在我确定是arrayList 造成了问题,因为如果我只放“00000”、“09878889”而不是phoneList - 它工作正常。该怎么办?谢谢..
编辑:
ArrayList<String> al = new ArrayList<String>();
HashSet<String> hs = new HashSet<String>();
hs.addAll(phoneList);
al.clear();
al.addAll(hs);
String[]arrString = new String [al.size()+1];
for (int j = 0; j < al.size(); j++) {
String str = al.get(j).toString();
arrString[j+1]= str;
}
arrString[0]= myPhone;
requestBuilder.or("userPhone",arrString);
这是我的解决方案,但我发现如果“arrString”大于 600+ 它不起作用,这是为什么呢?