I am developing a Multi-level(like folders with subfolders or files in it) app with GridScreen, that can have Sub-gridscreen (with videos) or just the Video Files depending on the variable
getContent="Yes" or "No" .
If the
getContent="yes" then I am calling
ShowGridScreen within itself again when the item is selected. And it works Great. But the problem is , when I pressed the GoBack button on roku, it goes to the previous Grid but throws an error on
return -1and then nothing works, I cannot select any videos/folders again.
Can you tell me what am I doing wrong ?
Function showGridScreen(screen As Object,SourceURL as string) As string
categoryList = getCategoryList(SourceURL)
screen.setupLists(categoryList.count())
screen.SetListNames(categoryList)
showArray = []
for i = 0 to categoryList.count()-1
channels = getShowsForCategoryItem(SourceURL,categoryList[i])
showArray[i] = channels
screen.SetContentList(i, channels)
end for
screen.Show()
while true
msg = wait(0, m.port)
if type(msg) = "roGridScreenEvent" then
if msg.isScreenClosed() then
return -1
else if msg.isListItemFocused()
print "Focused On: " + showArray[msg.GetIndex()][msg.GetData()]["title"]
else if msg.isListItemSelected()
print "Selected: " + showArray[msg.GetIndex()][msg.GetData()]["title"]
getcontent=showArray[msg.GetIndex()][msg.GetData()]["GetContent"]
if getcontent="Yes" then
print "We Need to retrieve Content"
newURL=showArray[msg.GetIndex()][msg.GetData()]["StoredURL"]
print newURL
newScreen = preShowGridScreen()
showGridScreen(newScreen,newURL)
else
print "No need to Grab Content, Playing Video"
showVideoScreen( showArray[msg.GetIndex()][msg.GetData()])
endif
endif
endif
end while
end function