Android Question [Solved] - Closing a Wait For Dialog after a set time or by setting an external value

JMB

Active Member
Licensed User
Longtime User
Hi,

I am trying to create a B4A program flow whereby I present a dialog asking the user for wifi credentials which will be passed to an ESP8266 chip access point to allow it to connect to the Wifi. I have had a lot of useful input so far, and am inching my way towards a solution :).

I present a dialog asking for the credentials, and then I call a resumable sub which disconnects from the current Wifi, and attempts a connect to the Access Point being broadcast by the ESP8266.

My question is how do I close a dialog after a certain period of time, or after a certain condition is met from another resumable Sub which is trying to carry out the connect? I use a dialog to present a label which shows the state of play with the attempt to access the ESP, but I'd like to be able to do stuff in that dialog once that access point has connected, or kill the dialog after a certain period of time.

I looked at this code

https://www.b4x.com/android/forum/t...stom-dialogs-and-async-methods.80204/#content

but this refers to an older way of doing things.

Is there a way of killing the dialog after a period of time, or after a specific parameter is set externally?

Thanks as always.

JMB
 

JMB

Active Member
Licensed User
Longtime User
But there's no way inside the dialog code to monitor variables? Hmm... obviously not, as they essentially closed packages, only revealing the views that are on them....

Just so I understand this correctly:

The only way (well, not the ONLY way but one obvious way) to interact with the views on an XUI Dialog is via timers modifying the Views' parameters?

And you can close the Dialog and get it to invoke a desired response by using Dialog.Close([a valid dialog response])?
 
Upvote 0
Top