If, Else help

Sniktaw

New member
Xiaomi Mi 10T Lite, Android 11, write secure privileges given

Hi, I'm having trouble with this If, Else force rotate macro. I'd like it to Force portrait when I launch Textra then cancel the Force rotation when I exit however, portrait remains enforced regardless. If I test the Actions individually they both work correctly. It's as if the Macro doesn't recognise Textra is launched. If I setup a simple Macro without the If, Else to Force portrait when Textra is launched it works so I know Macrodroid is detecting app launch.

Thanks in advance.

Screenshot_2022-04-05-10-25-49-468_com.arlosoft.macrodroid.jpg
 

Abalsam

Active member
Xiaomi Mi 10T Lite, Android 11, write secure privileges given

Hi, I'm having trouble with this If, Else force rotate macro. I'd like it to Force portrait when I launch Textra then cancel the Force rotation when I exit however, portrait remains enforced regardless. If I test the Actions individually they both work correctly. It's as if the Macro doesn't recognise Textra is launched. If I setup a simple Macro without the If, Else to Force portrait when Textra is launched it works so I know Macrodroid is detecting app launch.

Thanks in advance.

View attachment 2529
I think the problem is related to application open and closed. Android does not close applications when you leave them or always need to start applications when you next "open" therefore, I would suggest checking/triggering on if the app is in the foreground or not.
 

Abalsam

Active member
I think the problem is related to application open and closed. Android does not close applications when you leave them or always need to start applications when you next "open" therefore, I would suggest checking/triggering on if the app is in the foreground or not.
Of course to complicate matters, app in foreground or not is not a macrodroid trigger which means we need some other way to start the macro and then use of statements to test if your app remains in the foreground....
 

Sniktaw

New member
Try to change your else to else/if trigger fired application closed
@Snurre - I tried this and it works the opposite of how it did before. Launch Textra, auto rotate is on and working, exit Textra and portrait orientation is locked in other apps, launch Textra and auto rotate is on again. In other words, still not working as I want it ;o(
 
Last edited:

MacroDroidDev

Administrator
Staff member
On the face of it the macro looks fine and as I would expect.

Could you try the legacy option on the trigger (just configure the trigger and select this option).

Have you checked your system log, does it appear to be doing anything strange?
 
Top