Android Question I need urgent help with CustomListView update and JsonParser error

eSolution

Member
Licensed User
Longtime User
Hi, I have an app that use a customlistview (the class) to display the content of several youtube playlists. I use multiple requests to the yt api to get the content of the youtube playlists in batches of 50 videos then display the results in the custom list. I have a back button that will close the customlistview activity and return to the main menu (activity) then I can get the next 50 videos and send them to the customlistview and so on... The problem is that every time I call the clv activity the new videos are added to the old ones in the customlistview, the list is not starting clean, it has the videos from the last request in it... I have no idea how to fix this

The second problem is that the response from youtube is in json format and I'm using JsonParser . When I "click" on a menu item that request videos from a new playlist (different from the one already displayed when first using the app) I get a java error:

java.lang.RuntimeException: Object should first be initialized (Map).

(this error is given when I press the first menu item - videos 1 to 50 - the start of the first playlist or when I press the 5th menu item - videos 200 to 251)

Why I get this error since sometimes, for some requests (the requests are in the same format and will have a similar response from yt server) , it will display the results with no error???

How do I fix those errors?? I need urgent help with this :D

I have attached the project, please play a little with it, you will be able to reproduce the errors.

I use the latest b4a: 3.82 and this libs: CustomRSSView 1.2; HTTP 1.36; HttpUtils 2.01; JSON 1.1; Reflection 2.4; StringUtils 1.02
 

Attachments

  • projectListTest.zip
    15.8 KB · Views: 304
Top