How to stop a task when apps lose focus, last input time

210 views
Skip to first unread message

Alex Le

unread,
Apr 28, 2014, 10:29:44 AM4/28/14
to tas...@googlegroups.com
Is there a way to stop a task (associated with an application profile) when the app loses focus (pressing home or receiving phone call).  Also, can we track the last time (in seconds, maybe) the screen is touched or a button is pressed?

Matt R

unread,
Apr 28, 2014, 6:46:30 PM4/28/14
to tas...@googlegroups.com
Add an exit task to the profile (by long-pressing the enter task).  Add an action Stop <task name>.

To know when the screen is touched, you can run the shell command:
getevent -c 1 /dev/input/eventX
where X is the event number of the touchscreen which will be device-dependent.  That command requires root.

Matt


Alex Le

unread,
Apr 29, 2014, 10:06:29 AM4/29/14
to tas...@googlegroups.com
Thanks for the advise but after adding stop to the exit task, the task keeps running even after exiting the app. what I am trying to do is to execute the 'go hone' command after a period of time the app is running. I use the goto to loop, vibrate every 10 secs after 2 min, go home after 2.5 min. And also, how to stop the task while it is runnig too. Thanks

Rich D

unread,
Apr 29, 2014, 10:17:32 AM4/29/14
to Tasker Google Groups Post

> Thanks for the advise but after adding stop to the exit task, the task keeps running even after exiting the app.

1. Make sure you have selected the 'Enter' task name for the stop action in the exit task.

2. You will need to go into the profile properties and un- select the 'enforce task order' option.  Long press on profile name / properties.  I think beginner mode needs to be off as well in tasker preferences. 

 what I am trying to do is to execute the 'go hone'  command after a period of time the app is running. I use the goto to loop, vibrate every 10 secs after 2 min,  go home after 2.5 min. And also, how to stop the task while it is runnig too.

Just use a stop action within the task. Do not specify a task, it will defualt to the current task..

Rich D

unread,
Apr 29, 2014, 10:19:11 AM4/29/14
to Tasker Google Groups Post


It would be helpful as well if you could export your profile description and paste it here..

To post your profile or task here...  Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export description to clipboard (not XML)

Any linked tasks will be exported with the profile they are linked to..

The beginner mode needs to be off and the profile needs to have a name to be able to export.

Alex Le

unread,
Apr 29, 2014, 11:01:30 AM4/29/14
to tas...@googlegroups.com
Unchecking "Enforce Task Order" does the job. Thanks.
Reply all
Reply to author
Forward
0 new messages