Subject. Here is a sample code. VKApiAudio, as I understand it, stores only one audio recording obtained from Response. Then how to get them in large quantities? Is there a class in which they can be stored, such as VKApiCommunityArray? And how to work with them, for example, select only the Name and the Contractor?

public void onMyButtonClick(View view) { VKParameters params = new VKParameters(); params.put(VKApiConst.OWNER_ID, "1"); params.put(VKApiConst.COUNT, "3"); VKRequest requestaudio = new VKRequest("audio.get", VKParameters.from(VKApiConst.OWNER_ID, "1", VKApiConst.COUNT, "3")); requestaudio.executeWithListener(new VKRequest.VKRequestListener() { @Override public void onComplete(VKResponse response) { super.onComplete(response); VKApiAudio audio = (VKApiAudio) response.parsedModel; if (audio == null) { Log.v("Ошибка", "Ничего не загрузилось"); } else { Log.v("User name:", audio.artist + audio.title); } } @Override public void onError(VKError error) { super.onError(error); Log.v("l"); } }); 
  • I am not an expert, but judging by VKApiConst.COUNT, "3" in response should come up to three audio recordings, and not one. I think you can store them in a regular List (List) - Vladyslav Matviienko

1 answer 1

In this case, it is most likely an VKList <VKApiAudio> array of 3 elements.