How to get a notification to act on click

35 views
Skip to first unread message

SupremeAC

unread,
Oct 16, 2017, 9:13:14 AM10/16/17
to Tasker
I'm working on a project where I want to have a permanent notification running, with a 'yes' and a 'quit' button in the notification itself.  When I click one of the buttons, I start a task to cancel to notification and say stop another task.
It works, but it does so with a delay.  I think this is due to the fact that Tasker just places these new tasks at the back of the queue, meaning that if some other task is running, the notification won't get cancelled immediately.  Does anyone know of a way to circumvent this?  I tried working with profiles, thinking that these would run in parallel with any running task, but once you ask them to start a task, it gets put in the same queue.

Any help is more than welcome.

Sean Williams

unread,
Oct 16, 2017, 9:35:31 AM10/16/17
to Tasker
You will need to work out which task(s) are running and which require higher priority.

Using the perform Task action you can use the %priority variable with math, "%priority+1". Among other controls you have the Task Properties "Collision Handling".

Rich D

unread,
Oct 16, 2017, 2:20:45 PM10/16/17
to Tasker Google Groups Post


I think this is due to the fact that Tasker just places these new tasks at the back of the queue,

Use the run log to determine the exact cause of the delay. 

Rich D

unread,
Oct 16, 2017, 2:20:58 PM10/16/17
to Tasker Google Groups Post

Menu / more / run log

SupremeAC

unread,
Oct 17, 2017, 5:36:22 AM10/17/17
to Tasker


Op maandag 16 oktober 2017 15:35:31 UTC+2 schreef Sean Williams:
You will need to work out which task(s) are running and which require higher priority.

Using the perform Task action you can use the %priority variable with math, "%priority+1". Among other controls you have the Task Properties "Collision Handling".


So what does priority do?  Does it dictate what task starts when 2 tasks want to start simultaneously, or does it put one task in hold if one with a higher priority launches?  I tried setting the priority like you showed, but it didn't change anything.
As for collision handling, my understanding is that this only handles things when 2 of the same task are running?

SupremeAC

unread,
Oct 17, 2017, 5:42:47 AM10/17/17
to Tasker


Op maandag 16 oktober 2017 20:20:58 UTC+2 schreef Rich D:

Menu / more / run log


I checked and it was as I suspected.  I use a lot of flash messages to keep track of the task while it's running. 

Sean Williams

unread,
Oct 17, 2017, 6:12:24 AM10/17/17
to Tasker
So what does priority do?

Always worth checking the user guide. The explanation is far superior than I could achieve.

tasker.dinglisch.net/userguide/en/tasks.html


I tried setting the priority like you showed, but it didn't change anything.

Sorry, that wasn't a solution just a indication of your options. As Rich stated, use of the run log is important in figuring out the issue.


As for collision handling, my understanding is that this only handles things when 2 of the same task are running?

One option could be when using the notification click perform the same running task to kill the existing task - you have local variables available to you such as %caller() and %evt_prm().

SupremeAC

unread,
Oct 17, 2017, 7:19:22 AM10/17/17
to Tasker


Op dinsdag 17 oktober 2017 12:12:24 UTC+2 schreef Sean Williams:
I read the userguide.  Priorities should allow a task to jump the queue...  Priorities are new to me.  Can I set priorities for each seperate task, and if so: how?  I just have a string of tasks, one leading to another with 'perform task', without relying on profiles to start them based on context.  These tasks create notifications all of the same name so one replaces the other, but they all have a button that should stop any running tasks.  I created a seperate task for this, that should start whenever I click the button in the notification.  I can set the priority for this from within the notification, but it doesn't seem to change anything, it'll only start when the currently active task has ended.

Sean Williams

unread,
Oct 18, 2017, 9:32:05 AM10/18/17
to Tasker
Can I set priorities for each seperate task, and if so: how?

With perform task, yes. Otherwise tasks have set priorities depending on where they originated. See the user guide.

I just have a string of tasks, one leading to another with 'perform task', without relying on profiles to start them based on context. These tasks create notifications all of the same name so one replaces the other, but they all have a button that should stop any running tasks. I created a seperate task for this, that should start whenever I click the button in the notification. I can set the priority for this from within the notification, but it doesn't seem to change anything, it'll only start when the currently active task has ended.

Without going into detail on your particular setup, try using perform task from the notification click with a set priority of 50 (press the arrows and use the slider).

If it's a completely separate task from those that are running and it has a higher priority it should take priority over the others.

Put a beep as it's first action, good for troubleshooting.

SupremeAC

unread,
Oct 19, 2017, 4:50:25 AM10/19/17
to Tasker


Op woensdag 18 oktober 2017 15:32:05 UTC+2 schreef Sean Williams:
I raised the priority all the way to 50, but it doesn't make a difference.  the task will run as soon as the currently running (different) task is done, but it won't interrupt the currently running task.  No matter, I'll just work around it and perhaps try again later.

Reply all
Reply to author
Forward
0 new messages