gettedID
是一个公共变量,在onComplete
完成后获取一个值。如何在填充后执行某些代码而不使用单独的线程,我如何监听gettedID
值?
VKRequest request = VKApi.wall().get(VKParameters.from("domain", "bitcoin", VKApiConst.OFFSET, offset, VKApiConst.COUNT, count));
request.executeWithListener(new VKRequest.VKRequestListener() {
@Override
public void onError(VKError error) {
System.out.println("error: " + error);
}
@Override
public void onComplete(VKResponse response) {
super.onComplete(response);
try {
json = response.json.getJSONObject("response").getJSONArray("items");
for (int i = 0; i < json.length(); i++) {
returnArray.put(json.getJSONObject(i).get("id").toString());
}
gettedID = returnArray;
//Log.d("BTCR", "gettedID: " + returnArray.toString());
} catch (JSONException e) {
e.printStackTrace();
}
}
});