switch running apps with a single button press

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
boowho
Posts: 4
Joined: 07 Feb 2016 19:19

switch running apps with a single button press

Post by boowho » 27 Jan 2019 20:34

I have two apps running on the phone. I'd like to have a button (always on top) that would toggle between the two apps (bring to front) each time the button is pressed.

Can this be done with Automagic?? Maybe using a SSH command??

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: switch running apps with a single button press

Post by Desmanto » 28 Jan 2019 18:00

For the button, create a widget, use action click - action Control UI. At the control UI simply use

Code: Select all

recents(); 
sleep(100);
recents();
Pressing recent button twice usually will toggle between current app and previous app.

To show the widget, you need to create a flow with shortcut trigger, action Show Custom Widget Overlay, and another shortcut to Hide it.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply