How add and use this action?
Moderator: Martin
-
- Posts: 4
- Joined: 17 Mar 2019 02:57
How add and use this action?
Hi. Just fast question. In exposed i was use action: When i press one from hardware button i can check what activity is on first plan . And really miss that . How can i find this in Automagic?
Re: How add and use this action?
Hi,
You can use trigger Activity Started to detect activities. You can add an action Notification on Screen: {package_name}/{activity_class} to show the component name.
Regards,
Martin
You can use trigger Activity Started to detect activities. You can add an action Notification on Screen: {package_name}/{activity_class} to show the component name.
Regards,
Martin
Re: How add and use this action?
Alternative method, since you have root, you can use dumpsys command. Martin's solution works. But in case you don't want it to be triggered everytime you open other app and only want it to be trigger manually, dumpsys method will be more suitable. Use trigger Hardware Key event and choose your key. Then add execute root command
Then use regex in script to get the package name, app name and the activity.
Code: Select all
dumpsys window windows | grep -E 'mCurrentFocus'
Code: Select all
find = findAll(stdout, ' mCurrentFocus=Window\\{.* u\\d (.*)/(.*)\\}', true);
pn = find[0][1]; //package name
act = find[0][2]; //activity class
app = getAppName(pn); //app name
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.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.