• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to check what the app is in foreground now?

ldm1417

Member
Hello,

Is there a way to check that the certain app runs in the foreground now (it's user interface is currently displayed on the phone screen) and depending on the result to perform a certain action?

Thank you,
 
"very first "context" available is "application". Isn't that what you need?" - OK, I selected the app, what's next? How should I tell to Tasker that this profile should be triggered once this app in foreground (on the phone screen)?
In my Tasker there are only Activity, Services, Invert, and All buttons in the bottom of the App selection (Tasker->NewProfile->Application->here these buttons/options).
When I select 'Activity' for a specific App and then launch the App, the profile is not triggered. Why?
 
Last edited:
I'm a little confused.

If by App you mean Task then the answer is to have another task issue a Perform Task.

If by App you mean any installed app then have a task issue a Launch App.

… Thom
 
Hm... We are talking about a Profile, which should be triggered once a certain App is in foreground (displayed on the screen).
I did following: Tasker->NewProfile->Application-> selected an Application (let's say an Alarm app). Then I created a task, which should be performed once the Profile is triggered (a simple task, which just pops up a message).
Now, I launced the Alarm app, but nothing happens (likely the Profile was not triggered). But there is a strange phenomena - after that I cannot run the accociated task (which pops up a message) even manually... It seems the task is stuck or something like that... Make sense? Did I do all the things right?
 
Hello brother..just so you know Tasker has not limit..the only limit on it is that we don't know everything about it, unfortunately..and that takes time..I learned everything I currently know(keep in mind isn't that much as our friend Tom does) in Tasker 101 tutorials.

Good luck.
 
"What was the solution?" - leaving the problem as is :)

Till now the only solution is to re-launch the app -> wait a sec -> hope the app in the foreground now -> perform the action...

Would be glad to hear about a more intelligent solution ...
 
I've realized thanks or due to Tasker that some apps do run in the back ground..some others simply won't..they refuse no matter how much you try..I picked up a trick just recently..you have Tasker to keep the profile of the app alive as long as the screen status is on..

I hope that helps.
 
Back
Top Bottom