Home > Enterprise >  how to reach the 2nd array part here? android java
how to reach the 2nd array part here? android java

Time:01-31

how to reach the 2nd array part here?

enter image description here

The code snippet below doesn't matter, I added it to be considered a question.

apiService = ApiClient.createService(ApiService.class);
        Call<HomePage> call = apiService.getHomePage();
                call.enqueue(new Callback<HomePage>() {
                    @RequiresApi(api = Build.VERSION_CODES.N)
                    @Override
                    public void onResponse(Call<HomePage> call, Response<HomePage> response) {
                                assert response.body() != null;
                        //homePageList.addAll(response.body().getSections().stream().filter(a -> a.getSectionName() == "Slider").collect(Collectors.toList()).get(0).getContentList());
                

CodePudding user response:

There are different headings in the data. Where you send the request, for example, you can read it like this: example.getName(0); this will get index 0. you can take it as (1) to read the next one. I can only explain this much because you didn't give full details. But remember that arrays start from 0. Adjust accordingly when pulling your data. good luck. :)

  •  Tags:  
  • Related