sampleuserhere
Active member
Title says.
Concern
I have about 90% successful rate with this particular action. The majority of the execution ran the same exact line and yet these line failed occasionally due to timeout.
Executing through MD helper didn't introduce much different results either. It still failed occasionally. It's so weird.
This is the line I mention above. It retrieves the current foreground activity.
Why do I use this instead of {fg_app_package}? Because the said magic text takes account overlay as well.
It doesn't return app activity as well, which is the important part. I can't really settle with 5 seconds wait time then run the line once again either. I use this line to run different routines based on the activity I'm in when I perform an edge gesture.
Here's an example.
I swiped down to add an action in EditMacro activity, and while I was already in AddAction activity, swiping down added Set Variables instead. I do many other stuff as well which depends on the same mechanism.
I hope this could demonstrate why it's important for me to have this action this 100% reliable & quick.
TIA.
Concern
I have about 90% successful rate with this particular action. The majority of the execution ran the same exact line and yet these line failed occasionally due to timeout.
Executing through MD helper didn't introduce much different results either. It still failed occasionally. It's so weird.
This is the line I mention above. It retrieves the current foreground activity.
Code:
dumpsys activity activities | grep "mResumedActivity" | cut -d "{" -f2 | cut -d " " -f3 | sed "s/\///g"
Why do I use this instead of {fg_app_package}? Because the said magic text takes account overlay as well.
Magictext text for foreground app consistently returns different results compared to dumpsys and other plugins after certain situation. A bug?
Current behaviour {fg_app_name} and {fg_app_package} return current occupying foreground app. However if an overlay recently has just popped up or been interacted with, it returns that last overlay app instead. Demo. Expected behaviour {fg_app_name} and {fg_app_package} return current...
www.macrodroidforum.com
It doesn't return app activity as well, which is the important part. I can't really settle with 5 seconds wait time then run the line once again either. I use this line to run different routines based on the activity I'm in when I perform an edge gesture.
Here's an example.
I swiped down to add an action in EditMacro activity, and while I was already in AddAction activity, swiping down added Set Variables instead. I do many other stuff as well which depends on the same mechanism.
I hope this could demonstrate why it's important for me to have this action this 100% reliable & quick.
TIA.