piyushg098
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2018
08:49 AM
Stop a task running in background
I have a menu with four options. Each time a menu item is focused, an API is hit for the specific menu.
If a user switches focus between different menu at a faster rate I need to stop the task created for the previously focused menu. How can I do that?
I am showing a menu using a RowList on MainScene. The menu switching takes place on rowItemFocused of row list.
So anything I need to do has to be done from the main scene.
If a user switches focus between different menu at a faster rate I need to stop the task created for the previously focused menu. How can I do that?
I am showing a menu using a RowList on MainScene. The menu switching takes place on rowItemFocused of row list.
So anything I need to do has to be done from the main scene.
1 REPLY 1
BVatBBOD
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2018
05:03 PM
Re: Stop a task running in background
You need to stop the task using the task node's control field. https://sdkdocs.roku.com/display/sdkdoc/Task
So just grab a reference to the task that you previously started and set task.control="stop"
Let me know if you are unclear about this or need any further help. Also hit me up on the Roku Developers Slack Channel for quicker response. (see my signature)
So just grab a reference to the task that you previously started and set task.control="stop"
Let me know if you are unclear about this or need any further help. Also hit me up on the Roku Developers Slack Channel for quicker response. (see my signature)
Join the Roku Developers Slack Workspace for quicker help and great dev collaboration: http://tiny.cc/nrdf0y