Android Question Dialog.Show(...) messages in b4a App appear in reverse order of their coding sequence

beelze69

Active Member
Licensed User
Longtime User
Hi,

In a b4A application, I have a set of validations that I am performing as follows:

i) Validation 1 : If failed

Dialog.Show("Message 1")

ii) Validation 2: If failed

Dialog.Show("Message 2")

iii)Validation 3: If failed

Dialog.Show("Message 3")


However, these messages are displayed in 'reverse' order while the program is executing

i.e. assuming all 3 validations have failed then

the messages appear as follows

Dialog.Show("Message 3")

Dialog.Show("Message 2")

Dialog.Show("Message 1")

My doubt: How to make them display in the order of its coding


viz.

Dialog.Show("Message 1")
Dialog.Show("Message 2")
Dialog.Show("Message 3")

Please help.. Thanks.
 

Brian Dean

Well-Known Member
Licensed User
Longtime User
I think that you will find that all three dialogues are being displayed, in the order that you set in the code. If you dismiss Dialogue 3 then you should see Dialogue 2 underneath it, and Dialogue 1 underneath that. So just reverse your code order.

If you want to raise each dialogue on its own then you will have to change your coding and use Resumable Subs.
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
try this:
    Dim Dialog As B4XDialog 'lib: xui_view
    Dim xui As XUI
    Dialog.Initialize(Root)
    Dialog.Title="show messages"
    Wait For (Dialog.Show("message 1", "OK", "", "")) Complete (Result As Int)
    Wait For (Dialog.Show("message 2", "OK", "", "")) Complete (Result As Int)
    Wait For (Dialog.Show("message 3", "OK", "", "")) Complete (Result As Int)
 
Upvote 2

beelze69

Active Member
Licensed User
Longtime User
I think that you will find that all three dialogues are being displayed, in the order that you set in the code. If you dismiss Dialogue 3 then you should see Dialogue 2 underneath it, and Dialogue 1 underneath that. So just reverse your code order.

If you want to raise each dialogue on its own then you will have to change your coding and use Resumable Subs.
Hi Brian !

Thanks for the response..
 
Upvote 0
Top