Below is short snippet of my code. On back button press I can see "Reached End" printed in debugger console, but the channel doesn't exit. I am not using roImageCanvas anywhere in the project.
Function Main()
'Apply the theme
initTheme()
if GetAuthData() <> invalid then
response1=APICall(GetAPIurl()+"linked_roku.php?roku_code="+GetAuthData())
else
showRegistration()
endif
if response1 <> invalid then
if response1.status="true" then
'Show HOmeScreen
print "Status true"
SetXtraData("ctv_userid",response1.user.id)
homeScreen(0,2)
else
showRegistration()
endif
endif
print "Reached End"
End Function
function homeScreen(row as Integer,col as Integer)
'Normal API call for listing items in roGridScreen
dialog=ShowPleaseWait("Please wait","")
grid.SetUpBehaviorAtTopRow("stop")
grid.Show()
dialog.close()
while true
mresponse=APICall(GetAPIurl()+"message.php")
if mresponse.message <> invalid
if mresponse.message="r"
homeScreen(0,2)
else
'open roMessageDialog using a function call
endif
endif
if type(msg) = "roGridScreenEvent" then
if msg.isScreenClosed() then
return -1
exit while
elseif msg.isListItemFocused()
'no operation here
elseif msg.isListItemSelected()
'opens roSpringboardScreen using a function call
elseif msg.isRemoteKeyPressed()
'opens roMessageDialog using a functional call
endif
end if
end while
end function
Function ShowPleaseWait(title As dynamic, text As dynamic) As Object
port = CreateObject("roMessagePort")
dialog = CreateObject("roOneLineDialog")
dialog.SetMessagePort(port)
dialog.SetTitle(title)
dialog.ShowBusyAnimation()
dialog.Show()
return dialog
End Function
Thanks
Regards
Paras Nath Chaudhary