JavaStudent123!
JCHJava Community | Help. Code. Learn.
•Created by JavaStudent123! on 11/16/2024 in #java-help
Springboot post method issue
3 replies
JCHJava Community | Help. Code. Learn.
•Created by JavaStudent123! on 12/17/2023 in #java-help
Issue with asynchronous nature of volley calls
Hello,
Im having an issue with trying to do two volley calls from to the same api. Okay so basically I am using an api for video games. The first api call retrieves the id of the game based on the search string provided to the api. The second api call takes the id and get alot of info about the game. Here is my code below.
Okay so my issue is basically I think because of the asynchronous nature of the volley calls, my recyclerView isnt retrieving all the items that the api is returning. When Im debugging, if I check the size of the arrayList in the parseJson method, its 10 but the recyclerView is only showing 4 items. There is also a weird situation where if I debug and go through each everything step by step then all 10 items do show up in the recyclerView. This is what makes me think my issue is something with the asynchronous volley calls. Is it a good idea to execute volley calls like in the doReviewDownload function recursively? Is there any way to fix this issue with the volley calls conflicting with each other? I have only been using api's for a few months now and this is just a personal project that I thought would be cool to do.
4 replies