Trying to detect current app

453 views
Skip to first unread message

Rick Kasten

unread,
Jan 15, 2016, 4:54:36 PM1/15/16
to Tasker
I've been working with Tasker for a while now, and it seems to be getting more frustrating as I learn more about it. I have what I think is a very simple task to perform, but I've tried multiple iterations, and they all fail.

All I want to do is:
  • If the foreground app is Maps
    • enable mobile data
    • enable high accuracy location services
  • Else
    • enable power saving location services

I can't get Tasker to recognize the foreground app. I've tried

  • Profile > Application > Maps
    • Nothing happens
  • Profile > Application > Not Maps
    • Nothing happens
  • Profile > Event > Variables > Variable Set > %WIN
    • %WIN never gets set
    • I followed the instructions here, but it doesn't work
I don't know what else to do. Any assistance?

Wayne Longford

unread,
Jan 15, 2016, 8:26:25 PM1/15/16
to Tasker
Do you have the Tasker Accessibility service enable in Android?

Do you have any other profiles that are working? If not, is Tasker itself enable (coloured icon as opposed to grey)

Are you using Nova launcher by any chance?

Wayne Longford

unread,
Jan 15, 2016, 8:29:01 PM1/15/16
to Tasker
Sorry, just noticed the link you posted. So ignor questions 1 & 3!

Jean Dowe

unread,
Jan 15, 2016, 10:30:09 PM1/15/16
to Tasker
Can also use a shell command: dumpsys window windows | grep 'mCurrentFocus'

And see if the variable matches a name. I do this to detect the statusbar and phone app (for some reason, tasker can't see the phone app).

Jean Dowe

unread,
Jan 15, 2016, 10:30:14 PM1/15/16
to Tasker

Rich D

unread,
Jan 15, 2016, 11:23:09 PM1/15/16
to Tasker Google Groups Post


> I don't know what else to do. Any assistance?

In your android accessibly settings, try disabling tasker then enable tasker. 

If this works see this post..

https://groups.google.com/forum/m/#!msg/tasker/mJfahPrdK1M/0jAdm2FYPBgJ

Rick Kasten

unread,
Jan 16, 2016, 2:52:29 PM1/16/16
to Tasker
I decided to first uninstall Tasker and reinstalling it, and that fixed my problem. I also noticed that the Tasker icon in the upper left was all gray, but after reinstalling it, it is now back to its orange and gray colors. Does that indicate something was disabled? I checked all settings during the course of this, and Tasker was enabled everywhere where it needed to be. I do have a battery saver that is configured to ignore Tasker, but that's the only I can think of that would have hosed it. I will try running that task disabler again, and if Tasker reverts to gray I'll just uninstall that app, because it obviously doesn't handle its ignore list properly.

Brad Minion

unread,
Jan 16, 2016, 3:19:07 PM1/16/16
to tas...@googlegroups.com
Simply long press that ICON to enable/disable Tasker. I had issues with Tasker being disabled randomly and I think it was because I was accidentally pressing the disable button on the Tasker notification slide. I disabled that option and haven't had that problem since.

On Sat, Jan 16, 2016 at 1:52 PM, Rick Kasten <rickk...@gmail.com> wrote:
I decided to first uninstall Tasker and reinstalling it, and that fixed my problem. I also noticed that the Tasker icon in the upper left was all gray, but after reinstalling it, it is now back to its orange and gray colors. Does that indicate something was disabled? I checked all settings during the course of this, and Tasker was enabled everywhere where it needed to be. I do have a battery saver that is configured to ignore Tasker, but that's the only I can think of that would have hosed it. I will try running that task disabler again, and if Tasker reverts to gray I'll just uninstall that app, because it obviously doesn't handle its ignore list properly.

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages