Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kyleabaker
Visitor

roSearchScreen Back button not sending message

I'm working on a simple Roku Channel and have started implementing a search screen. However, I'm noticing that pressing the back button does not exit my while wait and return to the previous screen. Is there a back button setting that I need to enabled (similar to enabling the back button to exit message dialogs)?
0 Kudos
9 REPLIES 9
RokuChris
Roku Employee
Roku Employee

Re: roSearchScreen Back button not sending message

Does your screen have an isScreenClosed() handler that breaks out of the event loop?
0 Kudos
kyleabaker
Visitor

Re: roSearchScreen Back button not sending message

There is a close clause, however, it is never being triggered. Is the syntax wrong? It was literally copied and pasted from the sdk example. Partial and full searches are returning event messages as expected.

		print "Got Message:"; type(msg)
If (type(msg) = "roSearchScreenEvent") Then
If (msg.isScreenClosed()) Then
print "Search screen closed"
return -1
Else If (msg.isCleared()) Then
print "Search terms cleared"
history.Clear()
Else If (msg.isPartialResult()) Then
print "Partial search: "; msg.GetMessage()



Thanks for the help!

EDIT:
This is within a while loop, just to be clear. 🙂
0 Kudos
kyleabaker
Visitor

Re: roSearchScreen Back button not sending message

I'm still not able to trigger the isScreenClosed event using the back button from the search screen. Is there an SDK example project that I can take a look at where this is working? Or any idea why this isn't working in my code?
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: roSearchScreen Back button not sending message

Is there maybe a dialog open under your search screen? That can cause this kind of weirdness. Dialogs are meant to be modal and should never be left open in the stack.
0 Kudos
kyleabaker
Visitor

Re: roSearchScreen Back button not sending message

That is most likely the case due to my implementation. I have the following procedure for search:

1. Open app.
2. Press * for more options in a dialog (roMessageDialog)
3. If search is selected, open search screen (waiting in dialog loop for returned result from search screen)

So I need to exit the dialog before I can open a search screen if I want the back behavior here?
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: roSearchScreen Back button not sending message

"kyleabaker" wrote:
That is most likely the case due to my implementation. I have the following procedure for search:

1. Open app.
2. Press * for more options in a dialog (roMessageDialog)
3. If search is selected, open search screen (waiting in dialog loop for returned result from search screen)

So I need to exit the dialog before I can open a search screen if I want the back behavior here?


That's right.
0 Kudos
kyleabaker
Visitor

Re: roSearchScreen Back button not sending message

Thanks for your help Chris. It'll be a couple days before I'm near my Roku to test these changes, but I'll follow up if that works.

Off topic, is there any documentation that covers which theme settings apply to the Search screen? I'm apply them settings for roGridScreen layout for the main screen, but none of the styling is applied at all to the Search screen.
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: roSearchScreen Back button not sending message

"kyleabaker" wrote:
Off topic, is there any documentation that covers which theme settings apply to the Search screen? I'm apply them settings for roGridScreen layout for the main screen, but none of the styling is applied at all to the Search screen.


There's a column in the theme attribute chart that tells you which apply to which screens. http://sdkdocs.roku.com/display/sdkdoc/roAppManager
0 Kudos
kyleabaker
Visitor

Re: roSearchScreen Back button not sending message

Just a quick update. That was indeed the open dialog that was blocking the search screen from going back. Got that working and properly styled! Thanks for the help!
0 Kudos