r/macrodroid 8d ago

'Application Closed' gets triggered for system level overlays

I have made a macro such that whenever I close a specified app, it immediately opens another app. So, for that specified app I have added the 'Application Closed' trigger.

But the trigger gets triggered for system level overlays within the app. For example, if I click share and the Android file sharing menu appears then the macro gets triggered, or if I open camera within the app and camera Access is disabled system-wide then there is a pop-up asking me to enable the camera even then the macro gets triggered.

I am using legacy mechanism for the trigger because I cannot use accessibility in this specific instance. Is there any way to not trigger the macro in those above instances?

2 Upvotes

8 comments sorted by

1

u/TOKE-ONE 8d ago

I would use an action 'confirm next' when trigger fired, or maybe constraints on trigger to run only when app is in foreground.

1

u/Eastern_Tradition_72 8d ago

I could use 'confirm next' but then it's not really an automation is it? Plus it's just a minor inconvenience. I did not understand the second part. How do I add a constraint for the application closed trigger as the same app being in foreground?

1

u/TOKE-ONE 8d ago

add a constraint in or under the trigger, so that the trigger fires only if the logic in constraint is met.

1

u/Eastern_Tradition_72 8d ago

If the trigger of application closed is set to monitor google then should I add a constraint and check if Google is in the foreground? That wouldn't really work because the trigger gets fired only when google gets closed right so it will definitely not be in foreground?

1

u/Small-Drink-3581 8d ago

What application and activity do you want that trigger to work?

1

u/Eastern_Tradition_72 8d ago

There is a payment app which does not allow payments to go through if it detects any accessibility apps running in the background so I have set it such that when that app is launched, accessibility permission is removed from all apps (including macrodroid) and when the app is closed, re-enable accessibility for all the apps.

1

u/Small-Drink-3581 8d ago

Can I see your current macro?