Task priority

56 views
Skip to first unread message

Harry

unread,
May 31, 2023, 5:26:35 PM5/31/23
to Tasker
I have a task where I go into a loop. At the start of the loop I call a second task which basically shows a List Dialog and waits 60 seconds for input. I don't want the original task to continue until the List Dialog task is completed. The weird thing is that it works fine when the phone is not locked (screen on). When the screen is off it completes the loop with out waiting for the List Dialog task to complete. I have the List Dialog task set at priority 5. Maybe that is causing the problem?

Thanks,
Harry

Rich D

unread,
May 31, 2023, 5:58:34 PM5/31/23
to Tasker Google Groups Post
Well that is a interesting discovery.  The typical setting for the priority for a child task is 

%priority+1

That will set the child's Priority One higher than the parents priority. That could possibly fix your issue.


 The strange thing is that those dialogues will typically stop all tasks until the dialogue is complete. I never realized with the screen off that it would allow tasks to run. 

Rich D

unread,
May 31, 2023, 6:03:37 PM5/31/23
to Tasker Google Groups Post

Harry

unread,
May 31, 2023, 6:05:26 PM5/31/23
to Tasker
Rich,

Tried %priority+1. Same result. Works when the screen is on but not when the screen is off.

Rich D

unread,
May 31, 2023, 7:29:11 PM5/31/23
to Tasker Google Groups Post
Okay I just tried this on my device.  I guess I was not understanding what you were doing. For some reason I thought the list dialog was turning the screen on and displaying itself.   However that does not seem to be the case. 

In your test I assume the list dialog never gets displayed when your screen is off, is that correct?.  If so that means the list dialog is simply erroring out and the task is completing that is why your parent task continues so quickly. 


How would you like it to behave when the screen is off?

Harry

unread,
May 31, 2023, 7:54:47 PM5/31/23
to Tasker
You are correct the phone screen stays off. I was hoping that the List Dialog would be there when I turn the screen on so that I could select an item from the list. I'm old and I figure it should work the same as VB6 (or VBA) where a control like a Msgbox is modal and code does not continue until the dialog box is closed.

Rich D

unread,
May 31, 2023, 8:08:14 PM5/31/23
to Tasker Google Groups Post

You are correct the phone screen stays off.



I was hoping that the List Dialog would be there when I turn the screen on so that I could select an item from the list.

To do that you could test if the screen is off

If %SCREEN ~ off


 just before the list dialog action and if it is off,  then turn it on. You might need a very small wait action between the Turn On action and the list dialog action. 





I'm old and I figure it should work the same as VB6 (or VBA) where a control like a Msgbox is modal and code does not continue until the dialog box is closed.

That is is the way these Dialogs work. The issue you were having was the dialog action was erroring out because the screen was off so the child task errored out as well. 

Harry

unread,
May 31, 2023, 8:20:05 PM5/31/23
to Tasker
That worked. Seems like it shouldn't matter whether the screen is on or not.
Reply all
Reply to author
Forward
0 new messages