Heya. I tried using the control ui script that someone put in the forum to clear my recents but it executes the script as it should until the "click" part. It then just nags and hangs there with the script still active but unable to stop. What am i doing wrong? I thought maybe the button label but i changed that and still not completing.
The script i downloaded:
//////////////////////////////////
recents();
while (NOT existsElementById("com.android.systemui:id/recents_container"))
{
sleep(10);
}
while (existsElementById("com.android.systemui:id/app_thumbnail"))
{
longclickById("com.android.systemui:id/app_thumbnail");
while (NOT existsElementById("android:id/title"))
{
sleep(10);
}
click("CLOSE ALL");
clicked = click("CLOSE ALL");
if(not clicked)
{
home();
}}
(The last 6 lines is my slight modification)
My recents() clear button:
//////////////////////////////////
Closing recent() apps
Moderator: Martin
Re: Closing recent() apps
Sorry. Attachment didnt work.
Here is my recent() here
Here is my recent() here
Re: Closing recent() apps
Lol i tried a lot of variations and yes i used the overlay in control ui to determine what is available. This is my final attempt. I just cant doit
//////////////////////////SCRIPT/////////////////////////////
recents();
while (NOT existsElementById("com.android.systemui:id/recents_container"))
{
sleep(10);
}
while (existsElementById("com.android.systemui:id/app_thumbnail"))
{
longclickById("com.android.systemui:id/app_thumbnail");
while (NOT existsElementById("android:id/title"))
{
sleep(10);
}
value = existsElementById("com.android.systemui:id/recents_close_all_button");
sleep(10);
focus("CLOSE ALL");
sleep(10);
focus(540, 1839);
sleep(10);
click(540, 1839);
sleep(10);
click("CLOSE ALL");
sleep(10);
clickById("com.android.systemui:id/recents_close_all_button");
bounds = getBoundsById("com.android.systemui:id/dismiss_task");
sleep(10);
bounds = getBoundsByIdAndIndex("com.android.systemui:id/dismiss_task", 1);
sleep(10);
clickById("com.android.systemui:id/dismiss_task");
sleep(10);
clickByIdAndIndex("com.android.systemui:id/dismiss_task", 1);
sleep(10);
scrollForwardById("com.android.systemui:id/dismiss_task");
scrollForward(934, 1376);
scrollBackward("Close appname");
scrollBackward(540, 1101);
focus("Close appname");
click("Close appnsme");
clicked = click("Close appname");
if(not clicked)
{
back();
}}
//////////////////////////SCRIPT/////////////////////////////
recents();
while (NOT existsElementById("com.android.systemui:id/recents_container"))
{
sleep(10);
}
while (existsElementById("com.android.systemui:id/app_thumbnail"))
{
longclickById("com.android.systemui:id/app_thumbnail");
while (NOT existsElementById("android:id/title"))
{
sleep(10);
}
value = existsElementById("com.android.systemui:id/recents_close_all_button");
sleep(10);
focus("CLOSE ALL");
sleep(10);
focus(540, 1839);
sleep(10);
click(540, 1839);
sleep(10);
click("CLOSE ALL");
sleep(10);
clickById("com.android.systemui:id/recents_close_all_button");
bounds = getBoundsById("com.android.systemui:id/dismiss_task");
sleep(10);
bounds = getBoundsByIdAndIndex("com.android.systemui:id/dismiss_task", 1);
sleep(10);
clickById("com.android.systemui:id/dismiss_task");
sleep(10);
clickByIdAndIndex("com.android.systemui:id/dismiss_task", 1);
sleep(10);
scrollForwardById("com.android.systemui:id/dismiss_task");
scrollForward(934, 1376);
scrollBackward("Close appname");
scrollBackward(540, 1101);
focus("Close appname");
click("Close appnsme");
clicked = click("Close appname");
if(not clicked)
{
back();
}}
Re: Closing recent() apps
Ok so aftet a lot of messing around. I have finaly got the script to do the job... all is good
Re: Closing recent() apps
CLOSE ALL is the nuke button you have there. It is strongly advised not to do this. I have that kind of nuke button too, but I don't event want to touch it. In my previous MIUI ROM, that button will kill Automagic Accessibility services. The Acc service seems to be enabled, but actually have been slayed and can't perform any UI related action anymore.
Jsut leave all your recent app alone. Android nowadays is smart enought to manage the RAM usage. Only at some certain special cases that you need to kill manually. And that doesn't even require kill all. It is better to reboot to refresh all service at once.
Jsut leave all your recent app alone. Android nowadays is smart enought to manage the RAM usage. Only at some certain special cases that you need to kill manually. And that doesn't even require kill all. It is better to reboot to refresh all service at once.
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.