该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
这使用bomb 云端查询时出现的问题
final List histories = new ArrayList<>();
BmobQuery query = new BmobQuery();
query.addWhereEqualTo("user_id", "c72a3ab1ce");
query.setLimit(10);
query.findObjects(this, new FindListener() {
public void onSuccess(List list) {
System.out.println("ssssssssssssssssss");
for (User_history user_history : list) {
User_history user_history1 = new User_history();
user_history1.setUser_id(user_history.getUser_id());
user_history1.setOrder_id(user_history.getOrder_id());
Log.e("TAG", user_history1.getOrder_id());
Log.e("TAG", "-------------------------");
histories.add(user_history1);
}
System.out.println("-------------------------" + histories.size());
}
@Override
public void onError(int i, String s) {
Toast.makeText(History.this, "查询失败", Toast.LENGTH_SHORT).show();
}
});
HistoryAdapter adapter = new HistoryAdapter(this, histories);
listView.setAdapter(adapter);
System.out.println("-------------------------" + histories.size())
}
我在查询时adapter最后加载histories时histories里时没有数据,于是通过加断点和输出的方式发现每次他每次都是让adapter首先加载无值的histories然后才进内部类进行查询操作和histories的add操作进行赋值,所以每次都没有数据 求大神告知问题出在哪 怎样解决