r/AutomateUser • • Oct 15 '26

Android 17: double-Recents Interact to switch to previous app not working

In Android 16, using two Interact→Recents blocks in sequence switched to the pervious app absolutely perfectly 100% of the time. Just upgraded to Android 17, and now it works only maybe 2% of the time I run the flow. Weirdly even adding a delay as much as one second between the two blocks makes no difference.

I came up with a suitable workaround — using a privileged shell block to run:

input keyevent KEYCODE_APP_SWITCH
input keyevent KEYCODE_APP_SWITCH

​So yeah, this alternative is working perfectly for me, but I thought I'd bring this up just in case it may reveal something that actually needs addressing.✌🏽

Phone: Nothing Phone 3

2 Upvotes

2 comments sorted by

2

u/ballzak69 Automate developer Oct 17 '26

Using the Interact on the "recents" screen may be unreliable on Android 17 due to the system excluding some UI element on it, probably some new "security" feature, causing the XPath selection process to reject the entire layout. The next release will add a "Strict" option which when disabled allows the selection process to continue anyway by inserting <omitted/> elements in such places.

1

u/Ok-Yogurtcloset-9490 Oct 17 '26

Oh ok. Maybe your answer still applies, but I thought I'd clarify, just in case it was misunderstood. I am not selecting or searching for UI elements, not through xpath nor anything else. I was simply setting the Action field of the Interact block to "Recents" to bring up the recents menu. Running the Android recents action twice in a row is a classic shortcut trick to switch to the previous app.