sampleuserhere
Active member
I have an action block fired by multiple gestures I set up in other app. What this block does is simple, it broadcasts multiple data about the current screen. With this mechanic, I can have other routines fired based on the context of the screen.
Now here's where the problem arises. One of those broadcasted data is foreground application activity, which is retrieved by executing the following line with Shell Script action.
What bothers me the most is that for some unknown reason, Shell Script action timeouts itself occasionally. The code itself works as intended and yet sometimes it fails. I can't tell why at all.
I'd like to have this 100% reliable as I mostly want to trigger some routines on the spot. What approach should I use to do this?
TIA.
Now here's where the problem arises. One of those broadcasted data is foreground application activity, which is retrieved by executing the following line with Shell Script action.
Code:
dumpsys activity activities | grep "mResumedActivity" | cut -d "{" -f2 | cut -d " " -f3 | sed "s/\///g"
What bothers me the most is that for some unknown reason, Shell Script action timeouts itself occasionally. The code itself works as intended and yet sometimes it fails. I can't tell why at all.
I'd like to have this 100% reliable as I mostly want to trigger some routines on the spot. What approach should I use to do this?
TIA.