我正在尝试获取另一个类上列表的最大大小,以将其设置为另一个类的循环中的最大大小。结果,它没有读取我得到的大小。这是代码:
用户.java
private void populateList() {
CusInfoManipulator c = new CusInfoManipulator(this);
int max = c.getMaxSize();
for(int x = 0;x<max;x++){
HashMap<String, String> value= new HashMap<String,String>();
c.listData(x);
value.put("username", "Username: " + c.getUserL());
value.put("name","Customer Name: "+ c.getFnameL() +" "+ c.getLnameL());
value.put("address", "Address: " + c.getAddressL());
value.put("landmark", "Landmarks: " + c.getLandmrkL());
value.put("num1", "Contact Number 1: " + c.getNumL());
value.put("num2","Contact Number 2: " + c.getNum2L());
list.add(value);
}
}
解析云列表的最大大小:
List<ParseObject> searchItems = query.find();
int max = searchItems.size();
public int getMaxSize() {
return max;
}
有人可以帮我弄清楚我的代码出了什么问题以及为什么它没有达到最大尺寸吗?