Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
btpoole
Level 7

roListScreen contentList

Can somebody show me a simple example of how to set the roListScreen contentList using an array. The array contains title and url. I just want the roListScreen to show all of the titles it contains but for some reason I only get the last one.
Thanks in advance
0 Kudos
4 Replies
EnTerr
Level 8

Re: roListScreen contentList

You likely fell for this viewtopic.php?f=34&t=75278&p=460250#p460250
Give example code so someone can spot the issue.
0 Kudos
btpoole
Level 7

Re: roListScreen contentList

Here is the code, I only get the last title in the file to show on the screen.

textArr=CreatePlaylistText()
for each title in textArr
contentList = [

{
Title: title,

},

]
next

return contentList
0 Kudos
RokuMarkn
Level 7

Re: roListScreen contentList

You're setting contentList to a single-item array multiple times. contentList never has more than one element in it. This is what you want to do:


contentList = []
for each title in textArr
contentList.Push( { Title: title } ]
next
0 Kudos
btpoole
Level 7

Re: roListScreen contentList

Thanks again, works like it should.
0 Kudos