Hello,
I am kind of new to roku development and BrightScript. I have managed to build a application, but there are elements that I wish to protect with a pin screen, the only problem is that all the screens that I call after the pin screen do not react to the "back" button on the remote.
I have bypassed the pin screen to see if there was something wrong with the other screens, and they are working ok as long as they do not come after pin screen.
This is the function that shows the pin screen
sub showPinScreen()
screen = CreateObject("roPinEntryDialog")
screen.setTitle("Confirm your identity")
screen.addButton(1,"Next")
screen.addButton(0,"Cancel")
screen.SetNumPinEntryFields(4)
port= CreateObject("roMessagePort")
screen.setMessagePort(port)
screen.show()
while true
msg=wait(0, screen.GetMessagePort())
if(msg.getIndex()=1)
if(screen.pin()=regRead("pin", "authentication"))
showSelectionScreen()
screen.close()
exit while
else
screen.close()
showWrongPin()
exit while
endif
end if
if(msg.getIndex()=0)
exit while
end if
end while
screen.close()
Main()
end sub
Please tell me what I am doing wrong, or how I can make screens that are opened from the pin screen to react to the back button.