parsing JsonArray to Picasso library

后端 未结 1 885
攒了一身酷
攒了一身酷 2020-12-22 07:39

i have this Json Data

and i prasing the data in in this json to this ,,

now i want when user click on the image of the application open another acti

相关标签:
1条回答
  • 2020-12-22 08:29

    Here you are fetching first image from each array by doing following

    ....getJSONArray(entryKey).getJSONObject(i).getJSONArray(imageKey).getJSONObject(0)...

    whereas you need to fetch all the images related to selected image from the array so iterate your array on the inner image array im:image, not on outer main array entry. follow these steps

    1. Whenever you click on the image item then get the id of that item.
    2. iterate on the outer array entry and check if the clicked items id matches in the array entry.
    3. when it matches id then iterate on inner array im:immage and store those images in your list. And apply that list to your recyclerview.

    Hope this helps.

    0 讨论(0)
提交回复
热议问题