How to close confirmation dialog or update its text if...

Post your questions and help other users.

Moderator: Martin

Post Reply
kosamja
Posts: 9
Joined: 30 Nov 2017 11:08

How to close confirmation dialog or update its text if...

Post by kosamja » 01 Dec 2017 14:15

If global variable is used in confirmation dialog text, is it possible to close confirmation dialog or update its text when that variable changes? Example if variable changes value from 1 to 2 to display that new number in confirmation dialog or to exit dialog when number is changed?

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

Re: How to close confirmation dialog or update its text if..

Post by Desmanto » 02 Dec 2017 09:28

It is possible, you have to create a loop in the main flow which utilize the confirm dialog. Put the back button as confirm with false, operation cancel. Add a new expression to check the operation. If it is cancel, loopback to the confirm dialog.

At another flow, use trigger Global Variable, and use Control UI to press back() when it detect the the confirm dialog is exist. One of the way can be

Code: Select all

if(existsElementById("android:id/button1"))
  back();
This way, when the GloVar changet, it will trigger this control UI. Only if the confirm dialog is open, then it will press back, which then confirm with false, operation cancel. It will then loopback to the confirm dialog again in the main flow, but load up with new GloVar value.
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.

kosamja
Posts: 9
Joined: 30 Nov 2017 11:08

Re: How to close confirmation dialog or update its text if..

Post by kosamja » 02 Dec 2017 12:59

works, thanks

Post Reply